File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes new instance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "new instance" Watch "new instance" New topic

new instance

Venu Navat
Ranch Hand

Joined: Dec 28, 2004
Posts: 30
can we create an object for a class without using new keyword?how?/

-Venu Navat
marc weber

Joined: Aug 31, 2004
Posts: 11343

Well, there are special cases like String, Array, and (with 5.0 autoboxing) wrappers. But for general cases, there's the Class class...

Note that "newInstance" is a method name in Class, so "new" is not being used as a keyword.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Venu Navat
Ranch Hand

Joined: Dec 28, 2004
Posts: 30
thanks marc weber.........i got it......
Don't get me started about those stupid light bulbs.
subject: new instance
Similar Threads
Which type of an American would you be?
Testing a constructor....
Problem editing my message
Is the book a full rewrite of iPhone in Action
Place Association