How many objects and reference variables are created code? - ProProfs Discuss
Advertisement

How many objects and reference variables are created code?

How many objects and reference variables are created code?

Change Image    Delete

Thing item, stuff; item = new Object(); Thing entity = new Object();

Asked by Kalloorkar_bvk, Last updated: Nov 09, 2024

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

Chris Evins

Chris Evins

Want to explore the world.

Chris Evins
Chris Evins, College Student, Schooling, Wolverhampton

Answered Dec 02, 2019

There are two correct answers to this question.Three reference variables created. The three reference variables which are created are a thing, item, and stuff. The first object created is the item.

The second is the thing. Stuff doesn't create an object, but it is apart of the options. Both the objects and variables are important for Java. This is because it allows Java to create programs, games, and applications.

When it comes to the objects that are being created, the programmer needs to be specific. Any object that is missed could lead to the program failing completely.

upvote downvote
Reply 

K. Myers

K. Myers

K. Myers
K. Myers, Blogger, Chicago

Answered Feb 21, 2019

The three reference variable are the following: thing, item, and stuff. The item is the new object (first) and the thing is second. There is no object made from stuff but it is in the options thus the statement has 3 variables that were created. These objects and variables are the vertebrae of Java to create programs, applications, and even games.

A programmer needs to know and be specific in the objects he or she is creating to line them with his or her plans. A missed object can bring failure to a program so one must be careful in inputting all the needed objects as well as variables.

upvote downvote
Reply 

John Smith

John Smith

John Smith
John Smith

Answered Feb 24, 2017

Two objects created.
Three reference variables created.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.