Jump to content

  • Log In with Google      Sign In   
  • Create Account


Java, 'Use the interface keyword to declare instance variables?' oracle java apprentice test


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Moe091   Members   -  Reputation: 566

Like
0Likes
Like

Posted 02 November 2012 - 01:51 AM

Hello Gamedev, I'm gonna start studying for the Oracle Certified Java Apprentice certification soon so I was taking a practice test to see what it was all about. Most of it was pretty straight forward and easy but there were a few questions that I just totally didn't get. I don't know if It's just not a high quality test, or, more likely, My self taught understanding of Java is a bit off in some ways. Here is one question that really confused me:

Q: Which of the following keywords is used to declare an instance variable?

A - abstract
B - Constant
C - Concrete
D - interface

I had no idea what the answer was so I guessed, I don't even remember what, but according to the test the answer was interface, which really confused me. I thought it was asking which Java keyword you use when your declaring an instance variable(I didn't know the declaration was what determined whether something was an instance variable or not at all, I thought it had to do with whether it belonged to an instance of a class).

can someone explain this to me? What do the mean 'using the interface keyword to declare an instance variable?'

And clearly something is wrong with my understanding of instance variables and maybe interfaces, based on the little paragraph above explaining my understanding of the topic can anyone correct me so I can comprehend the whole big picture a little better.

Thanks guys

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6973

Like
0Likes
Like

Posted 02 November 2012 - 02:29 AM

You are certain that you got the question right ? Only abstract and interface are valid keywords and none is used to declare a variable.

If you already didn't know, take a look here when studying for OCJA.

#3 Glass_Knife   Moderators   -  Reputation: 3897

Like
0Likes
Like

Posted 02 November 2012 - 09:10 AM

You are certain that you got the question right ? Only abstract and interface are valid keywords and none is used to declare a variable.

If you already didn't know, take a look here when studying for OCJA.


I second that. That doesn't sound like a valid question. But I would say the fact that you had to ask the question means you do recognize something is weird.
I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#4 lride   Members   -  Reputation: 633

Like
0Likes
Like

Posted 02 November 2012 - 03:45 PM

abstract-used to declare class
interface-used to declare interface
concrete and constant-not java kewords..

I think the question meant what type you can use to declare an instance variable?
So reinterpreting the question

abstract-can't use abstract class type to declare an instance.
interface-valid. An interface can refer to a class type

constant and concrete-not java keywords

Edited by lride, 02 November 2012 - 04:16 PM.

An invisible text.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS