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
Write code of any action class?
What is udp in java?
Which is best ide for java?
What are assembly attributes?
Which is the best approach for creating thread ?
What is the benefit of using enum to declare a constant?
What is static class
Can we change the value of static variable?
Why convert an applet to an application?
Is java free for commercial?
How do you clear an arraylist in java?
What is navigable map in java?
What is complexity and its types?
What are the two categories of data types in the java programming language?
Can a class be a super class and a sub-class at the same time? Give example.