my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes mock test true or flase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "mock test true or flase" Watch "mock test true or flase" New topic
Author

mock test true or flase

Sham Grandhe
Ranch Hand

Joined: Dec 16, 2003
Posts: 73
hai friend,
The question given below is from a mock test, the ans is given as d but i feel even that is wrong plz clarify.
Which of the following are correct. Select the one correct answer.
1. An import statement, if defined, must always be the first non-comment statement of the file.
2. private members are accessible to all classes in the same package.
3. An abstract class can be declared as final.
4. Local variables cannot be declared as static.
ans d

thanking you
shyam
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Kumar,
I guess that by 'd' you mean '4'...
4. True. Local variables cannot be declared static, the "static" keyword being reserved for class variables declarations. The only modifier you may use in local variables declarations is "final". And access modifiers (private / protected / public) would not make any sense for local variables, because by nature, variables created on the stack are only accessible to the method they are declared in.
1. False. If defined, the first non-comment statement of the file is the "package" statement.
2. False. Private members of a class are only accessible from the class itself.
3. False. If an abstract class had to be declared as final, it could never be implemented.
Regards,
Phil.
Sham Grandhe
Ranch Hand

Joined: Dec 16, 2003
Posts: 73
hai Philippe,
thank you very much, for the ans provided in detailed manner.
with
regards
shyam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mock test true or flase
 
Similar Threads
Cleared Part I today with 79%
Innerclass Qn
need your help about a access qeustion.
doubts in mock exam ques
No. of choices ??