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
When do we use hashset over treeset?
What are the 3 types of control structures?
What are different types of references?
What is numeric function?
Why java applets are more useful for intranets as compared to internet?
What are data types in oop?
What is a Hash Table? What are the advantages of using a hash table?
Can you override private or static method in java?
List primitive java types?
What do you mean by compiler?
What is the difference between applet and application?
Why is java so important?
What are thread priorities and importance of thread priorities in java?
What does method mean?
Which data type is class in java?