aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Pls Explain  few lines of the code. 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 "Pls Explain  few lines of the code." Watch "Pls Explain  few lines of the code." New topic
Author

Pls Explain few lines of the code.

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Hi.
This is code explaining exception in initializers.
Can some one explain the comments code whihc says "cannot understand"
or give me link where i can understand the cncepts better.
It's simple but i still cant get it
Thnks.


The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18745
    
  40

Not sure what you are asking for... most of stuff that you marked are self explanatory... but okay...



Declare a private static method, name createHotelPool, that returns an array of Hotel instances.



Create an array of Hotel, with noOfHotels elements, and return it from the method.



Create a new Hotel object, and do nothing with it. If the creation of the object generates a RoomOccupancyTooHighException, then print out the stack trace.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Thanks Henry that helped Big time!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Pls Explain few lines of the code.