About Question com.enthuware.ets.scjp.v6.2.646 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scjp.v6.2.646 :

Post by ETS User »

When I run this, I get "B is an A". Yet, your answer says this is wrong and the "B is like a A". I haven't heard this 'like a' expression used before. Please explain.

Code: Select all

public class B implements A {


   int value1 = 10;



	public static void main (String [] args) {
	
	
	B  b = new B();

	if (b instanceof A){
		System.out.println("B is an A");
        }else{

		System.out.println("B is not an A");
	}

	}
}

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.646 :

Post by admin »

If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 40 guests