| Author |
problem about constructing Integer objects
|
kevinn lee
Ranch Hand
Joined: Feb 15, 2010
Posts: 87
|
|
Why doesent the code work for Integer but works for Double?
|
 |
Nicola Garofalo
Ranch Hand
Joined: Apr 10, 2010
Posts: 308
|
|
The code, as you wrote it compiles fine.
I didn't get your problem, sorry.
|
Bye,
Nicola
|
 |
kevinn lee
Ranch Hand
Joined: Feb 15, 2010
Posts: 87
|
|
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
Joined: Jul 08, 2003
Posts: 24051
|
|
|
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!
|
[Jess in Action][AskingGoodQuestions]
|
 |
kevinn lee
Ranch Hand
Joined: Feb 15, 2010
Posts: 87
|
|
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
Joined: Apr 10, 2010
Posts: 308
|
|
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
Joined: Feb 15, 2010
Posts: 87
|
|
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
|
 |
 |
|
|
subject: problem about constructing Integer objects
|
|
|