my dog learned polymorphism
The moose likes Beginning Java and the fly likes problem in multiple choice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "problem in multiple choice" Watch "problem in multiple choice" New topic
Author

problem in multiple choice

Saumyaraj Zala
Ranch Hand

Joined: Aug 06, 2012
Posts: 30



The output shoul be xycg but how could it be cxgy and xygc??
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 4901
    
    7

saumyaraj zala wrote:The output shoul be xycg but how could it be cxgy and xygc??

Well my advice to you is to format that class with proper indenting. Then you may be able to see how.

Right now it's a mess - even if it came that way from an SCJP book (they do it that way on purpose) - and it's preventing you from seeing how the class is structured.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Ishan Pandya
Ranch Hand

Joined: Feb 06, 2012
Posts: 138

[Moderator action] Removed "complete" solution. please see comment below.


OCPJP
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 4901
    
    7

Ishan Pandya wrote:"X"-static block is always called first...

Ishan, I'm sure you're intentions are good, but we try not to just hand out answers here - particularly in the "Beginning Java" forum.

Please look at the guidelines on the HowToAnswerQuestionsOnJavaRanch (←click) page.

Winston
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in multiple choice
 
Similar Threads
K&B chapter 8 Self Test Q 8
static class question
What is the sequence of execution?
casting error
Inner Classes