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
What does the exclamation mark mean in java?
Explain the different forms of polymorphism?
Is singleton a bad practice?
Is it possible to override private or static method in java?
Why call by value prevents parameter value change?
Is int primitive data type?
What is classpath?
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
Why webdriver is an interface?
What is a percentage sign called?
Can there be an abstract method without an abstract class?
Is int a class in java?
Can bool be null?
What does the string method compareto () do?
How to store image in arraylist in java?