This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 24166
    
  30

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
 
Similar Threads
wrapper class doubt
Wrappers
Retrieving different keys when the values in a hashmap are same???
Explicit casting