aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes E practice exam questions for SCJP 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

E practice exam questions for SCJP 5

Dibbo Khan
Ranch Hand

Joined: Dec 19, 2004
Posts: 147
I purchased the e practice exam and don't understand bits of 2 questions in the first practice exam.

QUESTION 4 Exam 1

1. interface Animal {
2. void eat();
3. }
4.
5. // insert code here
6.
7. public class HouseCat extends Feline {
8. public void eat() { }
9. }


abstract class Feline implements Animal { }
-- FIRST OF ALL WHY IS THIS A LEGAL IMPLEMENTATION OF THE interface it doesn't implement the eat() method.

Question 8 Exam 1

Given:

1. class Banana {
2. int x = 1;
3. public static void main(String [] args) {
4. int x = 2;
5. Banana b = new Banana();
6. b.go();
7. }
8. { x += x; }
9. void go() {
10. ++x;
11. System.out.println(x);
12. }
13. }


Whis is the { x += x; } part of this code snippet legal???


MCPD (Enterprise Application Developer, Windows Developer, Web Developer - .NET 2.0), MCTS (Windows Apps, Web Apps and Disbributed Applications - .NET 2.0), MCITP (Database Developer & Business Intelligence Developer - SQL Server 2005), MCAD, MSCD.net, SCJP 5, SCWCD 1.4, SCBCD, SCMAD, SCDJWS, SCJA
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Closing this thread. It is a duplicate. Please refrain from duplicate postings.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: E practice exam questions for SCJP 5