File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed
src/com/codefortomorrow/advanced Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter14 .practice ;
22
3- import java .io .*;
4-
53/*
64The file “numbers.txt” has 100 random numbers
75(one on each line). Use file i/o to find the
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter14 .practice ;
22
3- import java .io .*;
4-
53/*
64Practice: Use File I/O to compare two files lexicographically.
75Lexicographical order is very similar to alphabetical order,
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter16 .solutions ;
22
3- import java .util .*;
3+ import java .util .ArrayList ;
4+ import java .util .LinkedList ;
45
56/*
67Using the methods outlined in the “Benefits of LinkedLists” section,
1516
1617public class Access {
1718
19+ @ SuppressWarnings ("unused" )
1820 public static void main (String [] args ) {
1921 long a , b ;
2022
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter16 .solutions ;
22
3- import java .util .*;
3+ import java .util .LinkedList ;
4+ import java .util .Scanner ;
45
56/*
67Create a LinkedList of Strings, and ask the user to
@@ -38,5 +39,7 @@ public static void main(String[] args) {
3839 list .add (0 , "Apple" );
3940 list .add (list .size () - 1 , "Peanut" );
4041 System .out .println (list );
42+
43+ sc .close ();
4144 }
4245}
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter16 .solutions ;
22
3- import java .util .*;
3+ import java .util .Arrays ;
4+ import java .util .LinkedList ;
45
56/*
67Write a method which takes in a LinkedList of Strings
You can’t perform that action at this time.
0 commit comments