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 are the 4 types of characters?
What does g mean in regex?
How to calculate the length of a singly linked list in java?
What is a string what operation can be performed out with the help of a string?
What is size () in java?
What does the @override annotation do?
What is a function in programming?
What is the list interface?
how can you catch multiple exceptions in java?
What does it mean that a method or field is “static”?
Can you declare an interface method static?
When the constructor of a class is invoked?
How would you use Bubble Sort to sort the number of elements?
How many bits is size_t?
What is instance means in java?