File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
src/com/codefortomorrow/advanced/chapter16/solutions Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
package com .codefortomorrow .advanced .chapter16 .solutions ;
2
2
3
- import java .util .*;
3
+ import java .util .LinkedList ;
4
+ import java .util .ArrayList ;
4
5
5
6
/*
6
7
Using the methods outlined in the “Benefits of LinkedLists” section,
15
16
16
17
public class Access {
17
18
19
+ @ SuppressWarnings ("unused" )
18
20
public static void main (String [] args ) {
19
21
long a , b ;
20
22
Original file line number Diff line number Diff line change 1
1
package com .codefortomorrow .advanced .chapter16 .solutions ;
2
2
3
- import java .util .*;
3
+ import java .util .LinkedList ;
4
+ import java .util .Scanner ;
4
5
5
6
/*
6
7
Create a LinkedList of Strings, and ask the user to
@@ -38,5 +39,7 @@ public static void main(String[] args) {
38
39
list .add (0 , "Apple" );
39
40
list .add (list .size () - 1 , "Peanut" );
40
41
System .out .println (list );
42
+
43
+ sc .close ();
41
44
}
42
45
}
Original file line number Diff line number Diff line change 1
1
package com .codefortomorrow .advanced .chapter16 .solutions ;
2
2
3
- import java .util .*;
3
+ import java .util .LinkedList ;
4
+ import java .util .Arrays ;
4
5
5
6
/*
6
7
Write a method which takes in a LinkedList of Strings
You can’t perform that action at this time.
0 commit comments