File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Queries--2" Watch "Queries--2" New topic


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

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
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

Shaily Sharma, please quote your sources.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

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]
I agree. Here's the link:
subject: Queries--2
It's not a secret anymore!