in Education by
What is true about constructor? (a) It can contain return type (b) It can take any number of parameters (c) It can have any non access modifiers (d) Constructor cannot throw an exception This question was posed to me in an international level competition. I would like to ask this question from Constructor topic in section Classes and Methods of Java Select the correct answer from above options Java questions and answers, Java questions pdf, Java question bank, Java questions and answers pdf, mcq on Java pdf, Java questions and solutions, Java mcq Test , Interview Java questions, Java Questions for Interview, Java MCQ (Multiple Choice Questions),Core Java Questions, Core Java MCQ,core java interview questions for experiencedcore java interview questions for 3 years experience,java programming questions,core java interview questions for freshers,java interview questions and answers for freshers, java programming questions and answers pdf, java interview questions for beginners

1 Answer

0 votes
by
 
Best answer
The correct answer is (b) It can take any number of parameters For explanation: Constructor returns a new object with variables defined as in the class. Instance variables are newly created and only one copy of static variables are created.

Related questions

0 votes
    What is true about private constructor? (a) Private constructor ensures only one instance of a class exist at ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is true about protected constructor? (a) Protected constructor can be called directly (b) Protected ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is false about constructor? (a) Constructors cannot be synchronized in Java (b) Java does not provide ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Abstract class cannot have a constructor. (a) True (b) False I have been asked this question in ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What would be the behaviour if one parameterized constructor is explicitly defined? (a) Compilation error (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What happens if constructor of class A is made private? (a) Any class can instantiate objects of class ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of this keyword can be used in a subclass to call the constructor of superclass? (a) super ( ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B? ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is true about a break? (a) Break stops the execution of entire program (b) Break halts the ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is true about do statement? (a) do statement executes the code of a loop at least once (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which statement is true about java? (a) Platform independent programming language (b) Platform dependent programming ... and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is true about Class.getInstance()? (a) Class.getInstance calls the constructor (b) Class.getInstance is ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of the following is true about Java system properties? (a) Java system properties are accessible by any ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is correct about passing an argument by call-by-value process? (a) Copy of argument ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is true of final class? (a) Final class cause compilation failure (b) Final class cannot be ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
...