About Question com.enthuware.ets.scjp.v6.2.387 :

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

Moderator: admin

Post Reply
devlam
Posts: 50
Joined: Sun Nov 10, 2013 4:39 am
Contact:

About Question com.enthuware.ets.scjp.v6.2.387 :

Post by devlam »

In the answer there is nothing said about the instance variables the class contains.
I understand now that with declaration you only want the access-level, class-name, extends and/or implements?

I answered:
public class Polygon extends Shape {private List<Points>; private Color color; private boolean fillvalue;}

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

Re: About Question com.enthuware.ets.scjp.v6.2.387 :

Post by admin »

Yes, that is what is meant by declaration. What you have is definition.

HTH,
Paul.

piotrkmiotczyk
Posts: 27
Joined: Mon Sep 22, 2014 1:30 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.387 :

Post by piotrkmiotczyk »

This is very confusing. I don't have practical experience in java but, looking at the docs:

I don't think Oracle implies any distinction between class declaration and class definition here:
http://docs.oracle.com/javase/tutorial/ ... sdecl.html (see: first example)

And here it even says that declaration also "associates attributes with the declared identifier":
http://docs.oracle.com/javase/tutorial/ ... ssary.html (see: declaration, definition)

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests