SCJP 5.
Drag & Drop
1) Place code into the class so that it compiles & generates the out put answer=42. Note:
Code options may be used more than once.
Class
public class Place here {
private Place here object;
public Place here(Place here object){
[Link] = object;
}
public Place here getObject() {
return object;
}
}
public static void main(String[] args) {
Gen<String> str = new Gen<String>(“answer”);
Gen<Integer> intg = new Gen<Integer>(42);
[Link]([Link]() + “=” + [Link]());
}
}
Code Options
Gen<T>
Gen<?>
Gen
Ratna Prasad Page 1 of 36 Ver 1.0
SCJP 5.0
Solution:-
public class Gen<T> {
private T object;
public Gen(T object){
[Link] = object;
}
public T getObject() {
return object;
}
}
public static void main(String[] args) {
Gen<String> str = new Gen<String>(“answer”);
Gen<Integer> intg = new Gen<Integer>(42);
[Link]([Link]() + “=” + [Link]());
}
}
2) Given:
public void takeList(List<? extends String> list) {
// insert code here
}
Place the compilation results on each code statement to indicate whether or not
that code will compile if inserted into the takeList() method.
Code Statements Compilation Result
[Link](“Foo”); Compilation Fails
List = new ArrayList<String>(); Compilation Succeeds
List = new ArrayL:ist<Object>(); Compilation Fails
String s = [Link](0); Compilation Succeeds
Object o = list Compilation Succeeds
Ratna Prasad Page 2 of 36 Ver 1.0
SCJP 5.0
3) Place the correct description of the compiler output on the code fragments to be
inserted at liens 4 and 5. The same compiler output may be used more than once.
import [Link].*;
public class X {
public static void main(String[] args){
// insert code here
// insert code here
}
public static void foo(List<Object> list) {}
}
Code
a) ArrayList<String> x1 = new ArrayList<String>();
foo(x1);
b) ArrayList<Object> x2 = new ArrayList<String>();
foo(x2);
c) ArrayList<Object> x3 = new ArrayList<Object>();
foo(x3);
d) ArrayList x4 = new ArrayList ();
foo(x4);
Compiler Output
1) Compilation succeeds
2) Compilation fails due to an error in the first statement
3) Compilation of the first statement succeeds, but compilation fails due to error
in the second statement.
Solution:-
a=3
b=2
c=1
d=1
Ratna Prasad Page 3 of 36 Ver 1.0
SCJP 5.0
4) Place the output option in the actual output sequence to indicate the output
from this code.
class Alpha {
public void foo(String… args)
{ [Link](“Alpha:foo”);}
public void bar(String a)
{ [Link](“Alpha:bar”);}
}
public class Beta extends Alpha {
public void foo(String a)
{ [Link](“Beta:foo”);}
public void bar(String a)
{ [Link](“Beta:bar”);}
public static void main(String[] argv){
Alpha a = new Beta();
Beta b = (Beta)a;
[Link](“test”); [Link](“test”);
[Link](“test”); [Link](“test”);
}
Actual output sequence
1) 2) 3) 4)
Output options
Alpha:foo Alpha:bar Beta:foo Beta:bar
Solution:-
1) Alpha:foo 2) Beta:foo 3) Beta:bar 4) Beta:bar
Ratna Prasad Page 4 of 36 Ver 1.0
SCJP 5.0
5) Place the lines in the correct order to complete the enum.
enum Element {
1st
2nd
3rd
4th
5th
Lines
public string info() {return “element”;}
};
FIRE { public string info() {return “Hot”;}
EARTH, WIND,
}
Solution
EARTH, WIND,
FIRE { public string info() {return “Hot”;}
};
public string info() {return “element”;}
}
Ratna Prasad Page 5 of 36 Ver 1.0
SCJP 5.0
6) Place the code elements in order so that the resulting java sources file will
compile correctly, resulting in a class called [Link].
Source file
1st
2nd
3rd
ArrayList entries;
Code Element
package [Link],cert;
package [Link],cert.*;
import [Link].*;
import java.*;
public class AddressBook {
public static class AddressBook{
Solution: -
package [Link],cert;
import [Link].*;
public class AddressBook {
ArrayList entries;
Ratna Prasad Page 6 of 36 Ver 1.0
SCJP 5.0
7) Place the code fragment in position to complete the displayable interface.
interface Reloadable {
public void reload();
}
interface diplayable place here place here {
place here
}
Code Fragments:
extends public void display(); Reloadable
implements public void display() {/*Display*/} Edit
Solution:-
interface Reloadable {
public void reload();
}
interface diplayable extends Reloadable {
public void display();
}
8) Place the correct code in the code sample to achieve the expected results:
Expected Results:-
Output: 1 2 4 8 16 32
Code Sample:-
int [] y = { 1, 2, 4, 8, 16, 32};
[Link] (“Output: ”);
Place here
[Link] (x);
[Link](“ “);
}
Ratna Prasad Page 7 of 36 Ver 1.0
SCJP 5.0
Code:-
1) for(int x : y) {
2) for(int x = y[ ]){
3) foreach(y as x) {
4) foreach(int x : y) {
5) for (int x=1; x=y[ ]; x++){
Solution:-
int [] y = { 1, 2, 4, 8, 16, 32};
[Link] (“Output: ”);
for(int x : y){
[Link] (x);
[Link](“ “);
}
9) Chain these constructors to create objects to read from a file named “in” and to
write to a file named “out”.
reader = place here place here”in” ));
writer= place here place here place here”out” )));
Constructor
new FileReader( new PrintReader( new BufferedReader(
new BufferedReader( new FileWrite( new PrintWriter(
Solution:-
reader = new BufferedReader(new FileReader(“in”));
writer = new PrintWriter(new BufferedWriter(new FIleWriter(“out”)));
Ratna Prasad Page 8 of 36 Ver 1.0
SCJP 5.0
Place the code fragments into position to use a BufferedReader to read in an entire
text file:
class PrintFile {
public static void main(String[] args){
BufferedReader buffReader = null;
//More code here to initialize buffReader
try{
String temp;
while ( place here place here ) {
[Link](temp);
}
} catch place here
[Link]();
}
}
}
Code Fragments
(temp = [Link]() ) && [Link]()
(temp = [Link]()) (IOException e) {
!= null (FileNotFoundException e){
Solution:-
class PrintFile {
public static void main(String[] args){
BufferedReader buffReader = null;
//More code here to initialize buffReader
try{
String temp;
while ((temp = [Link]() ) != null ) {
[Link](temp);
}
} catch (IOException e) {
[Link]();
}
}
}
Ratna Prasad Page 9 of 36 Ver 1.0
SCJP 5.0
10) Given:
class A {
String name = “A”;
String getName() {
return name;
}
String greeting(){
return “class A”;
}
}
class B extends A {
String name = “B”;
String greeting(){
return “class B”;
}
}
public class Client {
public static void main(String[] args) {
A a = new A();
A b = new B();
[Link]([Link]() + “ has name ” + [Link]());
[Link]([Link]() + “ has name ” + [Link]());
}
}
Place the names “A” and “B” in the following output:
class place here has name place here
class place here has name place here
Names
A B
Solution:-
class A has name A
class B has name A
Ratna Prasad Page 10 of 36 Ver 1.0
SCJP 5.0
11) Car is Vehicle and Collectable class A implements B,C{}
Car Has Steering Wheel class A{B b;}
Car Has Wheels class A{List<B> b;}
Mini is A Car class A extends B{}
Car is an Object class A{}
12) Given:
[Link](“Pi is approximately %f and E is approximately %b”, [Link],
Math.E );
Place the values where they would appear in the output.
Pi approximately place here
and E is approximately place here
Values
3 3.141593 true [Link]
2 2.718282 false Math.E
Solution: -
Pi approximately 3.141593
and E is approximately true
13) The doesFileExist method takes an array of directory names representing a path
from the root filesystem and a file name. The method returns true if the file exists,
false if it does not.
Please the code fragments in position to complete this method.
public static boolean doesFileExist(String[] directories, String filename) {
Place here
for( String dir : directories) {
Place here
Please here
Please here
Ratna Prasad Page 11 of 36 Ver 1.0
SCJP 5.0
Code Fragments
path = return ![Link](); return (file != null)
[Link](dir);
String path = “”; path = File path = new File(“”);
[Link](filename);
return [Link](); return [Link](); File file = new File(path,
filename)
path = new File(path, dir); File path = new path = path + [Link]
File([Link]); + dir;
Solution: -
public static boolean doesFileExist(String[] directories, String filename) {
String path = “”;
for( String dir : directories) {
path = path + [Link] + dir;
File file = new File(path, filename);
return [Link]();
}
Ratna Prasad Page 12 of 36 Ver 1.0
SCJP 5.0
14) Given:
import [Link].*;
class A{}
class B extends A {}
public class Test {
public static void main(String[] args){
List<A> listA = new LikedList<A>();
List<B> listB = new LikedList<B>();
List<Object> listO = new LinkedList<Object>();
// insert code here
}
public static void m1(List<? extends A> list) {}
public static void m2(List<A> list) {}
}
Place a result onto each method call to indicate what would happen if the method
call where inserted al line 9. Note: Results can be used more than once.
Method Calls
m1(listA) m2(listA)
m1(listB) m2(listB)
m1(listO) m2(listO)
Results
Does not compile
Compiles and runs without error
An exception thrown at run time
Solution:-
m1(listA) Compiles and runs without error
m1(listB) Compiles and runs without error
m1(listO) Does not compile
m2(listA) Compiles and runs without error
m2(listB) Does not compile
m2(listO) Does not compile
Ratna Prasad Page 13 of 36 Ver 1.0
SCJP 5.0
15) Given:
NumberNames nn = new NumberNames();
[Link](“one”, 1);
[Link]([Link]());
Place the code into position to create a class that maps from Strings to integer
values. The result of execution must be [one]. Some options may be used more
than once.
public class NumberNames {
private HashMap< place here, place here> map =
new HashMap< place here, place here place here ;
public void put( String name, int value) {
[Link](place here, place here);
}
public place here getNames() {
return [Link]();
}
}
Code
Set<int> Set<Integer> HashSet
Set<Integer, String> Set<int, String> Set<String, Integer>
Set<String, int> Set<String> NumberNames
String Integer int
> >() name
Value map
Solution:-
public class NumberNames {
private HashMap< String, Integer> map =
new HashMap< String, Integer>();
public void put( String name, int value) {
[Link](name, value);
}
public Set<String> getNames() {
return [Link]();
}
}
Ratna Prasad Page 14 of 36 Ver 1.0
SCJP 5.0
16) Add methods to the Beta class to make it compile correctly
class Alpha {
public void bar( int… x ) {}
public void bar( int x ) {}
}
public class Beta extends Alpha {
Place here
Place here
Place here
Methods
private void bar( int x) {}
public void bar(int x) {}
public int bar(String x) {return 1;}
public Alpha bar(int x) {}
public void bar(int x, int y) {}
public int bar(int x) {return x;}
Solution:-
class Alpha {
public void bar( int… x ) {}
public void bar( int x ) {}
}
public class Beta extends Alpha {
public void bar(int x) {}
public int bar(String x) {return 1;}
public void bar(int x, int y) {}
Ratna Prasad Page 15 of 36 Ver 1.0
SCJP 5.0
17) Replace two of the modifiers that appear in the Single class to make the code
compile. Note: Three modifiers will not be used and four modifiers in the code
will remain unchanged.
Code
public class Single {
private static Single instance;
public static Single getInstance() {
if(instance == null) instance = create();
return instance;
}
private Single() {}
protected Single create() { return new Single();}
}
class SingleSub extends Single {
}
Modifiers
final
protected
private
abstract
static
Solution:-
public class Single {
private static Single instance;
public final Single getInstance() {
if(instance == null) instance = create();
return instance;
}
protected Single() {}
protected Single create() { return new Single();}
}
class SingleSub extends Single {
}
Ratna Prasad Page 16 of 36 Ver 1.0
SCJP 5.0
18) Given:
Runnable r = new Runnable() {
public void run() {
try {
[Link](1000);
} catch(InterruptedException e){
[Link](“Interrupted”);
}
[Link](“ran”);
}
};
Thread t = new Thread(r);
[Link]();
[Link](“started”);
[Link](2000);
[Link](“interrupting”);o
[Link]();
[Link](“ended”);
Assume that sleep(n) executes in exactly n milliseconds, and all other code executes in an
insignificant amount of time.
Place the fragments in the output area to show the result of running this code.
Output
Place here
Place here
Place here
Place here
Place here
Fragments
interrupted
ran
started
interrupting
ended
InterruptedException
(no more output)
Solution:
started
ran
interrupting
ended
(no more output)
Ratna Prasad Page 17 of 36 Ver 1.0
SCJP 5.0
19) Place a class on each method that is declared in the class.
Method Name
run()
wait()
notify()
sleep()
start()
join()
Class
[Link]
[Link]
Solution:-
run() [Link]
wait() [Link]
notify() [Link]
sleep() [Link]
start() [Link]
join() [Link]
Ratna Prasad Page 18 of 36 Ver 1.0
SCJP 5.0
20) Place the code fragments into position to produce the output:
true true false
Code
Scanner scanner = new Scanner( “One, 5, true, 3, true, 6, 7, false” );
[Link]( “,” );
while( place here ) {
if( place here ) {
[Link]( place here + “ “);
} else place here ;
Code Fragments
[Link]() [Link]()
[Link]() [Link]()
Solution:-
Scanner scanner = new Scanner( “One, 5, true, 3, true, 6, 7, false” );
[Link]( “,” );
while( [Link]()) {
if( [Link]()) {
[Link]( [Link]() + “ “);
} else [Link]() ;
Ratna Prasad Page 19 of 36 Ver 1.0
SCJP 5.0
21) Place the code in the appropriate places such that this program will always
output[1,2].
import [Link].*;
public class MyInt Place here Place here {
public static void main(String[] args) {
ArrayList<MyInt> list = new ArrayList<MyInt>();
[Link](new MyInt(2));
[Link](new MyInt(1));
[Link](list);
[Link](list);
}
private int i;
public MyInt(int i){ this.i = i ; }
public String toString() { return [Link](i); }
Place here int Place here {
MyInt i2 = (MyInt)o;
return Place here;
Code
implements extends Sortable Object
Comparable public i – i2.i i
i2.i – i compare(MyInt o, compare(Object o, sort(Object o)
MyInt i2) Object i2)
sort(MyInt o) compareTo(MyInt protected compareTo(Object
o) o)
Ratna Prasad Page 20 of 36 Ver 1.0
SCJP 5.0
Solution:
import [Link].*;
public class MyInt implements Comparable{
public static void main(String[] args) {
ArrayList<MyInt> list = new ArrayList<MyInt>();
[Link](new MyInt(2));
[Link](new MyInt(1));
[Link](list);
[Link](list);
}
private int i;
public MyInt(int i){ this.i = i ; }
public String toString() { return [Link](i); }
public int compareTo(Object o){
MyInt i2 = (MyInt)o;
return i-i2.i;
Ratna Prasad Page 21 of 36 Ver 1.0
SCJP 5.0
22) Place each Collection Type on the statement to which it applies.
Statements
allows access to elements by their integer index
defines the method: V get(Object key)
is designed for holding elements prior to processing
contains no pair of elements e1 and e2, such that
[Link](e2)
Collection Types
[Link]
[Link]
[Link]
[Link]
Solution:
allows access to elements by their integer [Link]
index
defines the method: V get(Object key) [Link]
is designed for holding elements prior to [Link]
processing
contains no pair of elements e1 and e2, [Link]
such that [Link](e2)
Ratna Prasad Page 22 of 36 Ver 1.0
SCJP 5.0
23) Place the code into the GenericB class definition to make the class compile
successfully.
import [Link].*;
public class GenericB< Place > {
public Place foo;
public void setFoo( Place foo) {
[Link] = foo;
}
public Place getFoo() {
return foo;
}
public static void main(String [] args) {
Generic<B> bar = new Generic<B>();
bar. setFoo(new Cat());
Cat c = [Link]();
}
}
interface Pet { }
class Cat implements Pet { }
Code
? extends Pet ?
T extends Pet T
? implements Pet <?>
T implements Pet Pet
Pet extends T
Ratna Prasad Page 23 of 36 Ver 1.0
SCJP 5.0
Solution:
import [Link].*;
public class GenericB< T extends Pet > {
public T foo;
public void setFoo( T foo) {
[Link] = foo;
}
public T getFoo() {
return foo;
}
public static void main(String [] args) {
Generic<B> bar = new Generic<B>();
bar. setFoo(new Cat());
Cat c = [Link]();
}
}
interface Pet { }
class Cat implements Pet { }
Ratna Prasad Page 24 of 36 Ver 1.0
SCJP 5.0
24) Place the fragments into position so the output is: The quantity is 420.
place here update(int quantity, int adjust){
place here
}
public void callUpdate() {
int quant = 100;
Place here
[Link](“The quantity is: ”+ quant);
Code fragments
public int quantity = quantity + adjust; update(quant, 320)
public void quant = update(quant, 320); quantity = quantity + adjust;
return quantity;
Solution:
public int update(int quantity, int adjust){
quantity = quantity + adjust;
return quantity;
}
public void callUpdate() {
int quant = 100;
quant = update(quant, 320);
[Link](“The quantity is: ”+ quant);
Ratna Prasad Page 25 of 36 Ver 1.0
SCJP 5.0
25) Place the code elements in position so that the flags2 class will compile and make
appropriate use of the wait/notify mechanism. Note: You may reuse code
elements.
public class Flags2 {
private boolean isReady = false;
public place here void produce() {
isReady = true;
place here;
}
public place here void consume() {
while(!isReady) {
try {
place here ;
} catch(Exception e) {}
}
isReady = place here;
}
}
Code Elements
synchronized true false wait()
Volatile synchronized() notifyAll() synchronize
Solution:
public class Flags2 {
private boolean isReady = false;
public synchronized void produce() {
isReady = true;
notifyAll();
}
public synchronized void consume() {
while(!isReady) {
try {
wait();
} catch(Exception e) {}
}
isReady = false;
}
}
Ratna Prasad Page 26 of 36 Ver 1.0
SCJP 5.0
26) Place the code elements into the class so that the code compiles and prints “Run.
Run. doIt.” In exactly that order. Note that there may be more than one correct
solution.
public class TesTwo extends Thread {
public static void main(String[] a) throws Exception {
TesTwo t = new TesTwo();
[Link]();
place here
place here
place here
}
public void run() {
[Link](“Run. ”);
}
public void doIt() {
[Link](“doIt. ”)
}
}
Code Elements
[Link](); [Link](); [Link](10); run();
[Link](); [Link](); doIt();
Solution:
public class TesTwo extends Thread {
public static void main(String[] a) throws Exception {
TesTwo t = new TesTwo();
[Link]();
[Link]();
[Link]();
[Link]();
}
public void run() {
[Link](“Run. ”);
}
public void doIt() {
[Link](“doIt. ”)
}
}
Ratna Prasad Page 27 of 36 Ver 1.0
SCJP 5.0
27) Given the class definitions:
class Animal {}
class Dog extends Animal {}
and the code:
public void go() {
ArrayList<Dog> aList = new ArrayList<Dog>();
takeList(aList);
}
// insert definition of the takeList() method here
Place the correct compilation result on each takeList() method definition to
indicate whether or not the go() method would compile given that definition.
takeList() Method definitions
public void takeList(ArrayList list) { }
public void takeList(ArrayList<Animal> list) {}
public void takeList(ArrayList<? extends Animal> list) {}
public void takeList(ArrayList<?> list) {}
public void takeList(ArrayList<Object> list) {}
Compilation Results
Compilation Succeeds
Compilation Fails
Solution:
public void takeList(ArrayList list) { } Compilation Succeeds
public void takeList(ArrayList<Animal> list) {} Compilation Fails
public void takeList(ArrayList<? extends Animal> list) {} Compilation Succeeds
public void takeList(ArrayList<?> list) {} Compilation Succeeds
public void takeList(ArrayList<Object> list) {} Compilation Fails
Ratna Prasad Page 28 of 36 Ver 1.0
SCJP 5.0
28) Given:
import [Link].*;
public class TestGenericConversion {
public static void main(String[] args) {
List list = new LinkedList();
[Link](“one”);
[Link](“two”);
[Link](((String)[Link](0)).length());
}
}
Refractor this class to use generics without changing the codes behavior.
import [Link].*;
public class TestGenericConversion {
public static void main(String[] args) {
Place here
[Link](“one”);
[Link](“two”);
Place here
}
}
Code
List list = new LinkedList(); [Link]([Link](0).length());
List<String> list = new [Link]([Link]<String>(0).length());
LinkedList<String>();
List<String> list = new [Link](<String>[Link](0).length());
LinkedList();
List list = new [Link]((list<String>)[Link](0)).length());
LinkedList<String>();
Ratna Prasad Page 29 of 36 Ver 1.0
SCJP 5.0
Solution:
import [Link].*;
public class TestGenericConversion {
public static void main(String[] args) {
List<String> list = new LinkedList<String>();
[Link](“one”);
[Link](“two”);
[Link]([Link](0).length());
}
}
29) Place the fragments into the program, so that the program will get lines from a
text file, display them, and then close all the resources.
Program
import [Link].*;
public class ReadFile {
public static void main(String[] args){
try{
File ? = new File(“[Link]”);
Place here ? = new Place here (x1);
Place here x4 = new Place here (x2);
String x3 = null;
while(( x3 = ? . place here()) != null) {
[Link](x3);
}?.place here();
} catch(Exception ex) {[Link]();}
}
}
Code Fragments
BufferedReader SreamReader FileReader readLine
readLn read closeFile close
x1 x2 x3 x4
Ratna Prasad Page 30 of 36 Ver 1.0
SCJP 5.0
Solution:
import [Link].*;
public class ReadFile {
public static void main(String[] args){
try{
File x1 = new File(“[Link]”);
FileReader x2 = new FileReader(x1);
BufferedReader x4 = new BufferedReader (x2);
String x3 = null;
while(( x3 = [Link]()) != null) {
[Link](x3);
}[Link]();
} catch(Exception ex) {[Link]();}
}
}
Ratna Prasad Page 31 of 36 Ver 1.0
SCJP 5.0
30) Insert six modifiers into the code such that it meets all of these requirements:
1) It must be possible to create instances of Alpha and Beta from outside the
packages in which they are defined.
2) When an object of type Alpha (or any potential subclass of Alpha) has been
created, the instance variable alpha may never be changed.
3) The value of the instance variable alpha must always be “A” for objects of type
Alpha.
Code:
package alpha;
place here class Alpha {
Place here String alpha;
Place here Alpha() { this(“A”);}
Place here Alpha(String a) { alpha = a;}
}
package beta;
place here class Beta extends [Link] {
place here Beta(String a) { super(a); }
Modifiers
private protected public
Ratna Prasad Page 32 of 36 Ver 1.0
SCJP 5.0
Solution:
package alpha;
public class Alpha {
private String alpha;
public Alpha() { this(“A”);}
protected Alpha(String a) { alpha = a;}
}
package beta;
public class Beta extends [Link] {
public Beta(String a) { super(a); }
31) Place the Types in one of the Type columns, and the Relationship in the
Relationship column, to define appropriate has-a and is –a relationship.
Type Relationship Type
Place here Place here Animal
Forest Place here Place here
Rectangle Place here Place here
Place here Place here Programming Book
Relationships Types
is – a Dog
has – a Side
Tail
Square
Tree
Book
Java Book
Pen
Solution:
Ratna Prasad Page 33 of 36 Ver 1.0
SCJP 5.0
Type Relationship Type
Dog is-a Animal
Forest has-a Tree
Rectangle has-a Side
Java Book is-a Programming Books
Ratna Prasad Page 34 of 36 Ver 1.0
SCJP 5.0
32) Given:
public class Doubler {
public static int doubleMe(Holder h) {
return [Link]() * 2;
}
}
And:
public class Holder {
int amount = 10;
public void doubleAmount() { amount = [Link](this);}
public int getAmount() {return amount;}
//more code here
}
Place the code fragments in position to reduce the coupling between Doubler and
Holder.
public class Doubler {
public static int doubleMe( Place here h) {
return Place here * 2;
}
}
public class Holder {
int amount = 10;
public void doubleAmount() { amount = [Link]( Place here );}
public int getAmount() {return amount;}
//more code here
}
Code Fragments
void Holder int doubler
[Link]() H this amount
Ratna Prasad Page 35 of 36 Ver 1.0
SCJP 5.0
Solution:
public static int doubleMe(int h){
return h*2
}
method call should be amount=[Link](amount);
33) Place each Collection Type on its function. Note: Not all functions will be used.
Function Collection Type
provides array manipulation utility [Link]
provides Collection manipulation utility [Link]
defines base methods for all array objects [Link]
defines base methods for all Collection [Link]
objects
provides a concrete implementation of an [Link]
ordered set
defines base methods for an ordered set
defines methods for linear access to a
collection
defines methods for random access to a
collection
Solution:
SortedSet : defines base methods for ordered Set
Arrays : provides Array manipulation utilities
Iterator : defines methods for Linear access to a collection
TreeSet : provides a concrete implementation of an ordered set
Collection : defines Base Methods for all collection Objects
Ratna Prasad Page 36 of 36 Ver 1.0