About Question enthuware.ocpjp.i.v11.2.3241 :

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

Moderator: admin

Post Reply
evgeniyN
Posts: 3
Joined: Mon Jan 13, 2020 9:03 am
Contact:

About Question enthuware.ocpjp.i.v11.2.3241 :

Post by evgeniyN »

I cant understand, why bool b = null; is not valid?

Code: Select all

class bool {}

...
bool b = null;

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

Re: About Question enthuware.ocpjp.i.v11.2.3241 :

Post by admin »

Did you try compiling it? What error message did you see?
If you like our products and services, please help us by posting your review here.

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

Re: About Question enthuware.ocpjp.i.v11.2.3241 :

Post by admin »

BTW, the explanation explains why it is not a correct option:
bool is an invalid keyword. Therefore, 1 and 4 can't be right. (Although 1 could be right if bool were a user defined class but as per Java coding conventions, a class name should start with a capital letter.)
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 35 guests