skip to main
|
skip to sidebar
Think smart
Saturday, February 20, 2010
Java Collection - Pic
Java Puzzles
1. Is it possible to cast like this ?
List
strings = new ArrayList
();
List
objects = strings;
2. Will this work ?
List
strings = new ArrayList
();
Collection
objects = strings;
3. Can we do it ?
Collection collection = new ArrayList
();
collection.add("newString");
4. will this work ?
List objects = new ArrayList
();
String s = (String) objects.get(0);
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)
Blog Archive
▼
2010
(2)
▼
February
(2)
Java Collection - Pic
Java Puzzles
►
2009
(3)
►
September
(2)
►
July
(1)
►
2008
(1)
►
April
(1)
About Me
Maniganda Prakash
View my complete profile