aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ID:5 SCJP Question of the day : Friday June 11 2010 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ID:5 SCJP Question of the day : Friday June 11 2010" Watch "ID:5 SCJP Question of the day : Friday June 11 2010" New topic
Author

ID:5 SCJP Question of the day : Friday June 11 2010

Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
Source :- Sahil Rally's Creation !!!



Quote at each line , Compilation Error or Runtime Error or Nothing???

Please be ready for ( Only for SCJP aspirants , even SCJP aspirants dont mind my statement , This is just to impart your more focus on the above question and to make you feel interested and enthusiastic )

Best Wishes !!!
Cheers!!!


Reference for rules:
http://www.coderanch.com/t/498524/java-programmer-SCJP/certification/ID-SCJP-day-Wednesday-June

SCJP 6.0 96%

(Connecting the Dots ....)
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
Line 1, runtime error IndexOutOfBoundsException
Line 2, Compile error, Expecting String got anything
Line 3, Compile time error, something with the char literal being empty
Line 4, Compile error, Expecting char, char got char, anything
Line 5, prints out "sahil", the substring method can take length argument, it just returns same string
Line 6, I'm gonna go with IndexOutOfBoundsException
Line 7, false


Sahil, thanks for the effort you put in these questions


Regards,

Martin


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 383

line 1: string index out of bound
line 2: false
line 3: i am really confused with this one ... if the two '' have no space then there has to be a compilation error otherwise it replaces fine
line 4: String.replace() does not accept boolean values as replacement parameter
line 5: again string out of bound
line 6: wrong end parameter .. string out of bound
line 7: true because i think no constructor will be called here as the string is already in uppercase ... i might be wrong though

good one sahil ... i really appreciate your efforts buddy ... these questions are really helping me to prepare for my scjp


http://plainoldjavaobject.blogspot.in
Abhinav Yadav
Ranch Hand

Joined: Nov 08, 2009
Posts: 34
@sahil nice question buddy, to me every line seems to give error except that last one,which will surely be true ,but the two sirs have already given the answers but i will also try ,here it goes:

Line 1, StringIndexOutOfBoundsException
Line 2, Should be false
Line 3, Char literal being empty compile time error
Line 4, Compile error,but cant think of a reason
Line 5, this should not print anything as there is no substring at 5
Line 6, may be index out of bounds
Line 7, true ,both the objects refer to same sequence of characters hence interned ,therefore its should be true

No Dream Too Big
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ID:5 SCJP Question of the day : Friday June 11 2010
 
Similar Threads
ID:11 SCJP Question of the Day !!!
ID:6 SCJP Question of the day : Saturday June 12 2010
ID:10 SCJP Question of the day !!!
subString
string assignment