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


Please Help Members By Posting Answers For Below Questions

When do we use hashset over treeset?

536


What are the 3 types of control structures?

531


What are different types of references?

534


What is numeric function?

542


Why java applets are more useful for intranets as compared to internet?

580






What are data types in oop?

555


What is a Hash Table? What are the advantages of using a hash table?

610


Can you override private or static method in java?

554


List primitive java types?

597


What do you mean by compiler?

585


What is the difference between applet and application?

546


Why is java so important?

652


What are thread priorities and importance of thread priorities in java?

628


What does method mean?

517


Which data type is class in java?

551