wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes problem about constructing Integer objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem about constructing Integer objects" Watch "problem about constructing Integer objects" New topic
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: 24183
    
  34

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem about constructing Integer objects