Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
What are the different ways to create an object in Java?
Krishnaveni Hanuman
Greenhorn
Posts: 10
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all
I recently encountered this question, " in how many ways, can we create an object in
Java
? "
I am familiar with the new keyword. Could someone kindly explain me which are the other ways to create object, using examples?
Thanks in advance
Jeff Verdegan
Bartender
Posts: 6109
6
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please
SearchFirst
(⇐click). A google search for
different ways to create an object in java
should give you your answer. If something is still not clear after that, post again.
Campbell Ritchie
Marshal
Posts: 79177
377
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Let's hear what you think.
Hint: this question comes up about once a year, so you might find old answers by
searching
Campbell Ritchie
Marshal
Posts: 79177
377
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I know at least three other ways which I didn't see in that search. But I didn't look at all the hits.
Campbell Ritchie
Marshal
Posts: 79177
377
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Earlier, I wrote:
I know at least three other ways . . .
Three
four.
But those ways are not necessarily applicable to every type of object.
saidi Bandi
Ranch Hand
Posts: 75
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Krishnaveni,
below are the ways to create an object.
[MODERATOR ACTION: Deleted full solution.]
Campbell Ritchie
Marshal
Posts: 79177
377
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you for removing that full solution, Jeff. Ironically, none of my four ways was in there
saidi Bandi
Ranch Hand
Posts: 75
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Apalogies Jeff.
Campbell,
can you give some clue to work on those ways
Campbell Ritchie
Marshal
Posts: 79177
377
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You have already been given lots of clues. What did you find when you followed them.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
anyone know how I could fix the errors in my code?
how to test if java.util.date object has 00:00:00 as hours,minutes,seconds
main() is declared as static
Error while inserting data in database using jsp
Returning Unique Objects from Methods
More...