aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Questions? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Questions?" Watch "Questions?" New topic
Author

Questions?

Raju Uprety
Greenhorn

Joined: Oct 17, 2000
Posts: 2
I have a Q?
interface MyInterfce{
1 int x=1;
2
}
What can be added on line 2? Choose (Three)
I choose 2, 5, 9, Is it right?
I guess an interace can not have access modifier. native is only for method. I think I can't use abstract for variable.
My guess final is right one? I still need to pick two more, so I choose 3, 9.
Anybody figure out which one is right one?
1) public int x=1;
2)protected int x=1;
3)transit int x=1;
4)private int x=1;
5)final int x=1;
6)native int x=1;
7)abstract int x=1;
9)volatile int x=1;
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Raju,
If you try compiling the code with the various options you get the following results:

Note, you cannot continue to use 'x' as the variable name; doing so produces a compile errror 'x already defined'.
Hope that helps.
------------------
Jane


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Serge Plourde
Ranch Hand

Joined: Jun 23, 2000
Posts: 140
You can't declare a member more than once!
 
 
subject: Questions?
 
Threads others viewed
a question from Biran's book
transient
Final methods
declaration question
JQ+
developer file tools