File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java might be unneccessarily difficult Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Java might be unneccessarily difficult" Watch "Java might be unneccessarily difficult" New topic
Author

Java might be unneccessarily difficult

Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787

[ August 19, 2003: Message edited by: Barkat Mardhani ]
Dan Lastoria
Ranch Hand

Joined: Jan 30, 2002
Posts: 57
I believe it is to enforce programmer responsibility in order to eliminate coding errors. It can also be easily solved by thus:
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
I understand that. But what is the logic behind implicit cast arbitarily in some place and not in other place. It just makes language more difficult without any benifit in MHO.
Barkat
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
The JLS explains why the designers of the language decided not to allow implicit narrowing of integer constants in method invocation conversions. JLS 5.3 Method Invocation Conversion
The rules for overloaded method resolution would be more complex otherwise.
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Thanks Marlene. That makes sense.
 
 
subject: Java might be unneccessarily difficult
 
Similar Threads
Float and Byte
Question about byte
Byte b = new Byte(123); //fails to compile ! :mad:
why I cann't assign FINAL INT to Byte
something odd with boxing/widening I can't figure out