Because the compiler doesn't execute any code. It doesn't know that "b".equals(s) is true. It is the JVM that executes the code.
Here is a good discussion about unreachable code: http://www.coderanch.com/t/662554/ocajp ... hable-code
About Question enthuware.ocajp.i.v7.2.849 :
Moderator: admin
-
admin
- Site Admin
- Posts: 10437
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Who is online
Users browsing this forum: krotki1234 and 38 guests