File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 19070
    
  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!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pls Explain few lines of the code.