Core Java Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 256 Page Views: 

Can the constructor be declared private?



Posted By: Avi Date: 6 November 2010 02:15:46 PM
 Answer:

Yes, in this case, you can’t create any instance for this class by using new.


Posted By: avibtech


Date: 6 November 2010 02:15:46 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image S5gp9h
Related Questions
Core Java : What is the Runtime class?

What is the Runtime class?

The Runtime class is a class which provide access to the Java runtime system
Category: Core Java Date: 11/7/2010 11:52:48 PM
Core Java : If a method is declared as protected, where may the method be accessed?

If a method is declared as protected, where may the method be accessed?

A protected method may only be accessed by classes or interfaces of the same package or by subclasse....
Category: Core Java Date: 11/7/2010 11:40:54 PM
Core Java : How are Observer and Observable used?

How are Observer and Observable used?

Objects that subclass the Observable class maintain a list of observers. When an Observable object i....
Category: Core Java Date: 11/7/2010 11:08:52 PM
Core Java : What is the constructor?

What is the constructor?

It is a method called when the runtime to create Objects of the class and initialize all the instanc....
Category: Core Java Date: 11/7/2010 10:46:46 PM
Core Java : What is polymorphism?

What is polymorphism?

It is that an object able to behave differently on different situations for the same message.
Category: Core Java Date: 11/7/2010 10:35:52 PM