About Question enthuware.ocajp.i.v7.2.1056 :

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

Moderator: admin

Post Reply
jajcee
Posts: 2
Joined: Thu May 08, 2014 11:37 am
Contact:

About Question enthuware.ocajp.i.v7.2.1056 :

Post by jajcee »

Can you specify in question that it is about top-level classes? Because in Leitner's mode when you can't see amount of correct answers you can answer "private class TestClass { }" as well as "final class TestClass { }".

Thank you.

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

Re: About Question enthuware.ocajp.i.v7.2.1056 :

Post by admin »

private class TestClass { } is incorrect whether you are considering only top level classes or all classes because you can subclass a private class in the same parent class.

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

jajcee
Posts: 2
Joined: Thu May 08, 2014 11:37 am
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1056 :

Post by jajcee »

admin wrote:private class TestClass { } is incorrect whether you are considering only top level classes or all classes because you can subclass a private class in the same parent class.

HTH,
Paul.
Oh, thanks, forgot about that :)

mihhay
Posts: 10
Joined: Wed May 09, 2018 12:48 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1056 :

Post by mihhay »

I am confused, what do you mean by : " The native keyword can only be used on methods, not on classes and or variables. " ?
Thank you !

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

Re: About Question enthuware.ocajp.i.v7.2.1056 :

Post by admin »

It means you cannot define class or variable as native. So the following code will not compile -
native class X{

}
class Y{
native int a;
}

But following code will compile -
class Z{
native void m1();
}
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests