Successfully reported this slideshow.
Your SlideShare is downloading. ×

Lets have a look at the JAVA declaration of an object- e-g- MyObject O.docx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 1 Ad

Lets have a look at the JAVA declaration of an object- e-g- MyObject O.docx

Download to read offline

Let’s have a look at the JAVA declaration of an object, e.g. MyObject O = new MyObject(); What does the variable O contain?
A. A reference (or pointer) to the object.
B. The object itself(all files and methods).
C. The value of the first field of the object.
D. A reference to the class declaration JAVA byte code.
Solution
Object Declaration :
MyObject O = new MyObject();
It is the most common way to create an object in java using new key word.
In this O simply holds the memory address of the actual \"MyObject\" object.
Option A is the correct choice.
.

Let’s have a look at the JAVA declaration of an object, e.g. MyObject O = new MyObject(); What does the variable O contain?
A. A reference (or pointer) to the object.
B. The object itself(all files and methods).
C. The value of the first field of the object.
D. A reference to the class declaration JAVA byte code.
Solution
Object Declaration :
MyObject O = new MyObject();
It is the most common way to create an object in java using new key word.
In this O simply holds the memory address of the actual \"MyObject\" object.
Option A is the correct choice.
.

Advertisement
Advertisement

More Related Content

More from sthomas232 (20)

Recently uploaded (20)

Advertisement

Lets have a look at the JAVA declaration of an object- e-g- MyObject O.docx

  1. 1. Let’s have a look at the JAVA declaration of an object, e.g. MyObject O = new MyObject(); What does the variable O contain? A. A reference (or pointer) to the object. B. The object itself(all files and methods). C. The value of the first field of the object. D. A reference to the class declaration JAVA byte code. Solution Object Declaration : MyObject O = new MyObject(); It is the most common way to create an object in java using new key word. In this O simply holds the memory address of the actual "MyObject" object. Option A is the correct choice.

×