>This point can be on the exam?
Yes, it is possible but most probably not.
About Question enthuware.ocajp.i.v7.2.1392 :
Moderator: admin
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1392 :
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Sat Jan 19, 2019 4:38 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1392 :
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.
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.
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1392 :
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?
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.
-
- Posts: 1
- Joined: Tue Jan 09, 2024 10:52 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1392 :
I have the same concern as you.Chanandler wrote: ↑Thu Aug 25, 2016 1:36 pmDid something go wrong here?
Look for correct/green answer and the explanation:and true for newStr.equals(myStr)
It's strange that admin hasn't responded to this for more than 7 years.
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1392 :
The reply to this query is there at the top of this page.itvase wrote: ↑Thu Jan 11, 2024 11:50 pmI have the same concern as you.Chanandler wrote: ↑Thu Aug 25, 2016 1:36 pmDid something go wrong here?
Look for correct/green answer and the explanation:and true for newStr.equals(myStr)
It's strange that admin hasn't responded to this for more than 7 years.
I am not sure what is the issue.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: pavvel and 23 guests