This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 18116
    
  39

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.
 
Similar Threads
Forward reference in a method
unreachable statements
Khalid pg 333-334
exception handling in instance initializer
Forward Referencing Doubt