File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Point2d.Double and Point2d.float

 
Manish Khurana
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Point2d class is an abstract class and has Point2d.Float and Point2d.Double as inner classes. I saw in one book of Java by Igor Hortan i think where he created instances of inner classes with out creating a outer Object. He had code like new Point2d.Float().
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Point2D.Float, not Point2d.Float. You have to be very careful about capital letters.

If you look through the API documentation for the Point2D class you will find you cannot instantiate Point2D anyway; you have to use one of the other three classes mentioned there. You can therefore write new Point2D.Float(1.0f, 99f);

I shall let you go through the API yourself to see what it says about not instantiating Point2D.
 
Manish Khurana
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YOU WROTE : new Point2D.Float(1.0f, 99f);
i had looked at api before. This means you are calling the constructor on an inner class that extends the enclosing class. As I understand it is not possible to create a object of the inner class without an object of the outer class.
 
Tim LeMaster
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looked up nested classes. There are 2 kinds of nested classes static and non-static (inner). Point2D uses static classes.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic