This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Queries--2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Queries--2" Watch "Queries--2" New topic
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

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: 3344

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