Can we have a private constructor ?
Answers were Sorted based on User's Feedback
Answer / namrata ahuja
no. constructors are always declared publicly. they are used
to initialize data members of a class. they are
automatically invoked by a class object declaration so if it
is private it cannot be invoked.
| Is This Answer Correct ? | 6 Yes | 39 No |
Answer / ravi`
no,
we can not make a constructor private , if we make a
constructor private its method cannot access in main method .
| Is This Answer Correct ? | 17 Yes | 136 No |
1. Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)
explain sub-type and sub class? atleast u have differ it into 4 points?
The company is a fake company asking for money of RS10000 while training and not offering a job after training. My humble request to you people not to attend Astersys interview
What is the difference between encapsulation and polymorphism?
What do you mean by public, private, protected and friendly?
design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }
What is a friend function & its advantage?
Why we are use # in begning of programme of c++.
define a string class. overload the operator == to compare two strings
2 Answers Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,
when my application exe is running nad i don't want to create another exe what should i do
What is new keyword in oops?
what is single inheritance?