answersLogoWhite

0

no we cannot initialize a constructor in private in order to call a constructor from outside of a class it must be a public member.in order to create an object we should call the constructor .so only private members can implement outside of the class.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do we invoke a constructor?

In Java, objects are constructed. Every time you make a new object, at least one constructor is invoked. Every class has a constructor, although if you don't create one explicitly, the compiler will build one for you. Ex: class Test { public Test() { } // this is Test's constructor public void Test() { } // this is a badly named, // but legal, method } If you see the example above, you would have realized that the constructor looks a lot like methods. Below are the main distinguishing factors between the constructor and normal methods: 1. The Constructor's name is exactly the same as the name of the class 2. They do not have a return type (Please remember this. A Constructor cannot have a return type as part of the code) 3. Constructors cannot be static, abstract or final


What is stcw code a code b?

The STCW Code, or the International Convention on Standards of Training, Certification and Watchkeeping for Seafarers, consists of two main parts: Part A and Part B. Part A outlines mandatory standards for training, certification, and watchkeeping for seafarers, while Part B provides guidance and recommendations on how to implement these standards. The code aims to enhance maritime safety and protect the marine environment by ensuring that seafarers are properly trained and qualified.


what are women's private part?

there private part is a secret


What is a pussy and a cock?

A puss’y is a girl’s private part and a cock is a man private part


Do schools in Sarasota fl have uniforms?

In Sarasota, Florida, public schools do not have a district-wide uniform policy; however, individual schools may implement their own dress codes that could include specific uniform requirements. Some charter and private schools in the area might require uniforms as part of their policies. It's best to check with the specific school for their dress code guidelines.


What are the similarities between constructor overloading and function overloading?

The only similarity is that both constructor and function overloads are distinguished by their signature -- the number and type of their arguments. Functions differ in that they also have a return type, which is also part of the signature, whereas constructors have no return type, not even void.


Is a Belly Button a Private Part?

A private part is any part that would normally be covered by clothing. So Yes is your answer.


What arethe advantages and disadvantages of aflowchart IN c language?

Nope, as flowcharts aren't part of C-language. Nonetheless, you can implement algorithms specified by flowcharts in C, but that might lead to unstructured code (also known as 'spaghetti-code'), which is outdated by forty years... Try using stuctograms instead.


My friend that is a girl told me there is a weakspot on girls but wont tell me were it is were is it?

The weak part of a girl is her private partThe weak part of a girl is her private part


What is the most ticklish part of a boy or a man?

His private part


Can you fish on streams on private property?

Definitely not. The stream is part of the private property.


What is Diznick?

private part of girls