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
Give an example of call be reference significance.
Is map sorted in java?
What is arrays sort in java?
What are Normalization Rules? Define Normalization?
What is meant by object oriented programming – oop?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
Can we override tostring method in java?
Can we use a default constructor of a class even if an explicit constructor is defined?
What is the exact difference in between Unicast and Multicast object?
What ide should I use for java?
What is public static void main?
How do I enable java in safari?
What is a variable in java?
How do you create immutable object in java?
Write a function to find out longest palindrome in a given string?