| Author |
Queries--2
|
Shaily Sharma
Ranch Hand
Joined: Sep 10, 2007
Posts: 39
|
|
1) When does an overloaded constructor gets invoked, without explicit call to it from default constructor. 2)List list = new ArrayList(); Iterator<String> it = list.iterator() From where does iterator() method comes? ArrayList() doesn�t implement this method, list has it but how its possible to invoke it, as interface doesn�t provide its implementation, how can we invoke this method? 3) Mock exam drag n drop question: String str = �April 15, 2005�; Date date = DateFormat.__________(_________, Locale.US).____________(str) Code Fragments: DateFormat.FULL , getDateInstance, parse, getDate, format ,getDateFormat, DateFormat.LONG, DateFormat.SHORT if i put parse option in last slot it gives parseException. wats the correct way?
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
1) When it's called from somewhere other than the default constructor. 2) That's the beauty of polymorphism. 3) Which date format are you using (FULL, LONG, or SHORT)? One of these will work.
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12928
|
|
|
Shaily Sharma, please quote your sources.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Raghavan Muthu
Ranch Hand
Joined: Apr 20, 2006
Posts: 3327
|
|
|
Also, its always better to use Use a meaningful subject line .
|
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
|
 |
 |
|
|
subject: Queries--2
|
|
|