Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java might be unneccessarily difficult

 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ August 19, 2003: Message edited by: Barkat Mardhani ]
 
Dan Lastoria
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marlene. That makes sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic