Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are the methods available in a class?

1074


Write a program to solve producer consumer problem in java?

999


Name the components that are termed to be Heavy-weight component but available in Light-weight components?

2488


What do the thread?class methods run() and start() do?

1023


Which is bigger float or double java?

966


How would you convert bytes to string?

975


Why bytecode is called bytecode?

1182


How to sort array in descending order in java?

914


Are floats faster than doubles?

1051


Difference between a process and a program?

1108


What isan abstract class and when do you use it?

1586


I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

1161


What is the type of lambda expression?

1013


Can we start a thread twice in java?

971


What are design patterns and please explain?

1076