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

Started by
2 comments, last by lride 11 years, 5 months ago
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
Advertisement
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.

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"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

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
An invisible text.

This topic is closed to new replies.

Advertisement