this code compiles just fine, if you try to insert
System.out.println(c); right after int c; then compilation will fail.
About Question enthuware.ocajp.i.v7.2.940 :
Moderator: admin
-
- Posts: 32
- Joined: Wed Mar 14, 2012 5:45 pm
- Contact:
-
- Site Admin
- Posts: 10067
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.940 :
That is correct and that is why option 5 (The code will compile and run without any problem. ) is marked as correct.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 32
- Joined: Wed Mar 14, 2012 5:45 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.940 :
sorry, my bad. I'm stressed out . I need to go and get the chill pilladmin wrote:That is correct and that is why option 5 (The code will compile and run without any problem. ) is marked as correct.
HTH,
Paul.
-
- Posts: 2
- Joined: Tue Oct 09, 2012 11:20 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.940 :
Detailed explanation in Java Language Specification
4.12.5. Initial Values of Variables
http://docs.oracle.com/javase/specs/jls ... jls-4.12.5
4.12.5. Initial Values of Variables
http://docs.oracle.com/javase/specs/jls ... jls-4.12.5
-
- Posts: 29
- Joined: Wed Apr 17, 2013 9:22 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.940 :
Nice mention, diafour. It's always useful to consult the JLS (although it's kinda hard to read) because it seems to be the only 100% truthful source in case of doubts.
Who is online
Users browsing this forum: No registered users and 209 guests