Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autoboxing question

 
Veer Batra
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following code gives compile time error at line //a. Should it not use autoboxing to convert int(primitive) to Integer(wrapped).



Thanks in advance.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you certain you're compiling with Java 1.5? It works fine for me.
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

javac -J-version

Use this to see your compiler version
 
Veer Batra
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for advising me to check version of java. Which actually seems the problem, However I am not able to establish which version I am using while in TextPad. But when I check at Dos prompt it gives me as under :

C:\Documents and Settings\Windows 2000>javac -version
javac 1.5.0_02

C:\Documents and Settings\Windows 2000>java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)

Good news is that compilation and execution works at Dos prompt.

Any idea how to check java version while in Textpad.

FYI, I strongly believe that I have only one version of Java on my PC and that is 1.5.0_02.
 
Veer Batra
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Few other things which I tried:
1. uninstalled TextPad and Installed again but still same problem.
2. in TextPad/Tools/Run I tried to run "Javac -version" and I got "javac 1.5.0_02"
 
Veer Batra
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I installed Jbuilder yesterday which screwedup the setting. I uninstalled JDK as well as TextPad and installed again. JDK first and then TextPad and that fixed the problem. Thanks.

Veer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic