Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
Beginning Java
private constructers
gopala krishna muvvala
,
Greenhorn
Aug 26, 2008 05:50:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Is possible to create object for private constructer in
java
in this way
class demo
{
private demo(
String
s)
{
System.out.println(s);
}
public static void main(String[] ar)
{
demo d=new demo("gopal");
}
}
[ August 26, 2008: Message edited by: gopala krishna muvvala ]
satishkumar janakiraman
,
Ranch Hand
Aug 26, 2008 06:11:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Yes. Objects can be created in the class itself. Check Singleton
pattern
for more information
Campbell Ritchie
,
Marshal
staff
Aug 26, 2008 09:32:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Welcome to JavaRanch
There was similar discussion last week:
here
.
Post by:
autobot
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
This thread has been viewed 659 times.
Similar Threads
User defined First class objects
Constructor
main()
arrays & String
Can objects share each other's private data ?
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:35:34
.