What is the purpose of a constructor?     It creates an array of data values associated with an object.     It prints all of the information about our object.     It returns all data members from an object back to the main method.     It allows us to set our own default values when we create an obj

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

What is the purpose of a constructor?

   

It creates an array of data values associated with an object.

   

It prints all of the information about our object.

   

It returns all data members from an object back to the main method.

   

It allows us to set our own default values when we create an object.

in java

Expert Solution
Step 1

Actually, constructor is a method it is used to initialize the objects.

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT