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...

Can we create object of class with private constructor?

Answer Posted / fareed

yes we can

public class Person{
privat Person(){
}
public hai(){
System.out.prinln("hai guys");
}
public static Person getobj(){
return new Person();
}

public class Manage{
public static void main(String[] args){
Person pr=Person.getobj();
pr.hai();
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State what is encapsulation and friend function?

1215


Can enum be null?

974


What is stream in oop?

1262


Why is oop useful?

1061


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6645


What is difference between polymorphism and inheritance?

1034


Can main method override?

1080


What is an advantage of polymorphism?

1057


What is solid in oops?

1075


What exactly is polymorphism?

1094


Can destructor be overloaded?

999


What is oops in simple words?

1052


Why do we use oops?

976


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

2588


class type to basic type conversion

2357