my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Constructor arguments in Wrappers 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 "Constructor arguments in Wrappers" Watch "Constructor arguments in Wrappers" New topic
Author

Constructor arguments in Wrappers

vijayakrishna Mikkilineni
Greenhorn

Joined: Nov 10, 2009
Posts: 24
The following code compiles:


But how is it possible. In java docs, Boolean class has only two types of constructors:


Does Auto boxing apply to constructor args also or is it to only method args?


Vijayakrishna M
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

This code snippet should clear it up



It compiles just fine


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Rein de Boer
Greenhorn

Joined: Jul 12, 2009
Posts: 15
vijayakrishna Mikkilineni wrote:
Does Auto boxing apply to constructor args also or is it to only method args?


I would say that a constructor is like any method (with respect to the arguments).
 
 
subject: Constructor arguments in Wrappers
 
Similar Threads
AutoBoxing question
Boolean
doubt in boxing
comparing Boolean wrappers objects
Boolean: valueOf() and equality doubt