• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem about constructing Integer objects

 
kevinn lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why doesent the code work for Integer but works for Double?
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code, as you wrote it compiles fine.

I didn't get your problem, sorry.
 
kevinn lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicola Garofalo wrote:The code, as you wrote it compiles fine.

I didn't get your problem, sorry.


but this is what I get
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You most likely created your own class named "Integer", at some point, and the Integer.class file is still laying around on your class path somewhere. If you can't find it on your own, use your operating system's "Find File" tool -- it's there somewhere!
 
kevinn lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote:You most likely created your own class named "Integer", at some point, and the Integer.class file is still laying around on your class path somewhere. If you can't find it on your own, use your operating system's "Find File" tool -- it's there somewhere!


yeah I did.now it compiles fine
thanks a lot
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice.

don't tell me you downloaded a jdk without the java.lang package or you are in trobule

Joking aside,

Check your path.

Open a shell and type javac - version
What do you see?
 
kevinn lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicola Garofalo wrote:Nice.

don't tell me you downloaded a jdk without the java.lang package or you are in trobule

Joking aside,

Check your path.

Open a shell and type javac - version
What do you see?

no the thing was that I had created a class named Integer and the compiler was looking for the constructor in that instead of the java.lang.Integer
thanks for replying
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic