Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does groovy internally deals with primitives ?

 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,

I was reading Gina(Groovy in Action) and its Section 3.1 clearly states that in Groovy World everything is 'Object' and replaces corresponding wrappers wherever required.
I tried a small example as follows:

On decompiling found that in line1 groovy replaces new Integer(1) but for line2 it declares int variable (rather then Integer reference type).
Any of the rancher wants to throw some light on this ?


Regards,
Shroff.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic