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

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

Moderator: admin

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

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

Post by admin »

>This point can be on the exam?
Yes, it is possible but most probably not.
If you like our products and services, please help us by posting your review here.

rali14043
Posts: 2
Joined: Sat Jan 19, 2019 4:38 pm
Contact:

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

Post by rali14043 »

This is a bug in Java since If I write the following line they don't compile:

String newStr = null (compiles successfully)
String newStr1 = Null (does not compiles)
String newStr2 = NULL (does not compiles)
String newStr3 = abcd (does not compiles)

I don't understand while String newStr = null compiles while any other values don't compile.

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

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

Post by admin »

Java is case sensitive. null is a keyword but Null and NULL are not. Neither is abcd. So, the compiler thinks that Null, NULL, and abcd are variable names.

Also, pay close attention to the error message. It will tell you exactly what the compiler is thinking.

Are you following any book?
If you like our products and services, please help us by posting your review here.

itvase
Posts: 1
Joined: Tue Jan 09, 2024 10:52 pm
Contact:

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

Post by itvase »

Chanandler wrote:
Thu Aug 25, 2016 1:36 pm
Did something go wrong here?

Look for correct/green answer and the explanation:
and true for newStr.equals(myStr)
I have the same concern as you.
It's strange that admin hasn't responded to this for more than 7 years.

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

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

Post by admin »

itvase wrote:
Thu Jan 11, 2024 11:50 pm
Chanandler wrote:
Thu Aug 25, 2016 1:36 pm
Did something go wrong here?

Look for correct/green answer and the explanation:
and true for newStr.equals(myStr)
I have the same concern as you.
It's strange that admin hasn't responded to this for more than 7 years.
The reply to this query is there at the top of this page.
I am not sure what is the issue.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: pavvel and 23 guests