[HD Pg 0, Sec. 4.7.0 - exercise]

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
sandeepnegi1996
Posts: 1
Joined: Sat Aug 15, 2020 9:11 am
Contact:

[HD Pg 0, Sec. 4.7.0 - exercise]

Post by sandeepnegi1996 »

This question is from the book OCP Java se 11 part 1
Exercise 4.7
Ques 4

Add an instance variable of type Bird in Bird. Initialize this variable
on the same line using "new Bird()" syntax. Instantiate a Bird object
in TestClass's main and execute it. Observe the output.


Here I am not able to understand what is the meaning of initialize the variables and the meaning of instantiate a Bird Object. Can you tell me the solution for this one :joy:

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: [HD Pg 0, Sec. 4.7.0 - exercise]

Post by admin »

Please go through section 1.3 Declaration and Definition, which explains the meaning of initialization of a variable and section 4.1 Declare and instantiate Java objects, which explains instantiation.

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests