File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

small doubt

 
vivek gaur
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) what does 'instanceof' operator mean?
2) what actually happens if we remove static from main?
3) when do we use Wrapper classes and why?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) instanceOf will tell you the type is an object is of any particular type.
For example :

means "if myCar is a Car class or subclass then"

2) try it yourself

3) Wrapper classes offer useful methods. Have a look at the Integer class. You can convert a number into hexadecimal, octal, binary, double, float....
 
Layne Lund
Ranch Hand
Posts: 3061
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3) Wrapper classes are often used when you need an Object but you have a primitive type instead. For example, you can "wrap" an int into an Integer in order to store it in a Collection.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic