This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes doubt in implicit narrowing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "doubt in implicit narrowing " Watch "doubt in implicit narrowing " New topic
Author

doubt in implicit narrowing

Vaibhav Chauhan
Ranch Hand

Joined: Aug 16, 2006
Posts: 115
does implicit narrowing occurs during calling a method giving argument type which is wider than the type of parameters in the definition of method ??

e.g.

// method call
long a=5,b=6;
add(a,b);

// method def.
void add(int a, intb)
{
//body
}
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
5.3 Method Invocation Conversion

Method invocation conversions specifically do not include the implicit narrowing of integer constants which is part of assignment conversion (�5.2). The designers of the Java programming language felt that including these implicit narrowing conversions would add additional complexity to the overloaded method matching resolution process (�15.12.2).
Vaibhav Chauhan
Ranch Hand

Joined: Aug 16, 2006
Posts: 115
thanks owen...
 
Don't get me started about those stupid light bulbs.
 
subject: doubt in implicit narrowing