aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Interface question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Interface question" Watch "Interface question" New topic
Author

Interface question

sreedhar lak
Ranch Hand

Joined: Feb 26, 2006
Posts: 42
Hi,
I have a doubt in the answer for the below.I read this question from one mock exam.
Which of the following statements about interfaces is correct?


A Due to Java's principle of single inheritance, a class declaration can only name one interface.

B All methods in an interface have default accessibility unless declared otherwise.

C All methods in an interface have public accessibility.

D An interface may not contain any variables.



Correct option "C"
A - No, a class declaration may include multiple interfaces.

B - No, all methods in an interface are implicitly public.

C * Yes, all methods in an interface are implicitly public, no matter how the interface itself is declared.

D - No, interfaces may define static final variables

They provided check box ,to select multiple.
My options are C,D
Please tell me Wht is my mistake
Thanks a lot


Thanks a lot<br />Learn from yesterday, live for today, hope for tomorrow. The important thing is to not stop questioning
Bastin Gomez.H
Ranch Hand

Joined: Dec 12, 2005
Posts: 54
All the variables in an interface are by default - public, static & final. Since it is final, the value cannot change. So it acts as a Constant.
Graham Walsh
Greenhorn

Joined: Mar 08, 2006
Posts: 23
Hi,

while it's not the right answer, what is this statement suggesting? I know its not the right answer but can somebody show me an example of code that
does what this sentence states. Its a question of wording for me. I don't see what they're trying to convey.

A - No, a class declaration may include multiple interfaces.


Originally posted by Bastin Gomez.H:
All the variables in an interface are by default - public, static & final. Since it is final, the value cannot change. So it acts as a Constant.


thanks

G
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interface question