• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Autoboxing question

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you certain you're compiling with Java 1.5? It works fine for me.
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
rubbery bacon. rubbery tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic