• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Implicit conversions

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

with the above code can i infer that implicit expansion conversion is allowed on primitives of the arguments.where as implicit narrowing is not.
Is there any thing more to it.
 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rajgopal reddy:

with the above code can i infer that implicit expansion conversion is allowed on primitives of the arguments.where as implicit narrowing is not.
Is there any thing more to it.




I think that implicit Expansion conversion is always allowed on primitives as well as Object References of the arguments, whereas implicit narrowing is not.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rajgopal reddy:
...with the above code can i infer that implicit expansion conversion is allowed on primitives of the arguments.where as implicit narrowing is not. Is there any thing more to it.


Yes, there is more to it. Read the following thread...

https://coderanch.com/t/250819/java-programmer-SCJP/certification/FINAL-VARIABLE
 
rajgopal reddy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much that was so clear explanation.
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic