Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in multiple choice

 
Saumyaraj Zala
Ranch Hand
Posts: 56
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The output shoul be xycg but how could it be cxgy and xygc??
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ishan Pandya
Ranch Hand
Posts: 226
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Moderator action] Removed "complete" solution. please see comment below.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic