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 |
Can we have a private constructor ?
12 Answers HSBC, Ness Technologies, TCS, Wipro,
Can enum be null?
What are the three main types of variables?
How long to learn object oriented programming?
why oops need in programming
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
How do you define social class?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
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)
wht is ditch
How do you achieve polymorphism?
create a c++ program that will accepts 9 inputs using 3 by 3 array.