Is it possible to create object with out its default
constructor? if possible how? else not possible? justify

Answer Posted / suresh royal

yes we can create object without using default constructor.
we can use argument constructor...
this is the example prg
===========================================
class ExArgCon
{
ExArgCon(int a)
{
System.out.println("arg constroctor");
}
public void m1()
{
System.out.println("m1() method");

}
public static void main(String[] args)
{
ExArgCone = new ExArgCon(10);
e.m1();
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the list interface?

817


What is the nested interface?

784


Write a program in java to establish a connection between client and server?

701


What is the primitive type byte?

758


What is meant by interface?

769


What is the difference between instanceof and isinstance?

743


What are the limitations of procedural programming approach?

735


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

876


What are operators and its types?

801


What is console based application in java?

770


Is Constructor possible in abstract class in java ?

790


What is a protected void?

695


What an i/o filter in java programming?

785


Define Multiprogramming and Multiprocessing in java.

776


What is classname class in java?

743