• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Changes between java versions.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone! I have just registered here. Thanks in advance!

I am having probably a very basic problem, but I can't figure it out myself.

I am trying to learn Java, I got a lot of material about it, but the java they teach are of different versions. I am running Java 6 using Eclipse, and sometimes I get stuck in a very simple exercise like HelloWord or Add2Integers...
I am trying to run an Add2Integers program, but I can't "import acm.program.*" or extend "ConsoleProgram" as the book says, also the "readInt " does not work, where says "println" only works if I use "System.out.println".

I have searched on the java website the syntax changes between the version, or what have changed between the versions, I couldn’t find anything to clarify. One of the videos I downloaded says that using a different version is not a big deal, but it is since I can’t run a simple exercise.

It is probably very simple for who knows, but it is getting me frustrated!

Thanks a lot!




CCNA. But useless in programming.
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java 6 is the latest version of Java and it is backwards compatible, so any standard Java stuff in your teaching materials should work.

Your problem is that the acm.program package and the ConsoleProgram class are not part of standard Java. They are probably in a third party jar file that you need to include in your classpath when compiling or running your program. Either your teachers or the teaching materials should tell you how to get hold of this jar file.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice to see you again, Joanne. And welcome to the Ranch, Alex Manfredi
 
Alex Manfredi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good to know that it is not a syntax that changed or so.

I don't remember they saying where to get those JAR files. I going to look again anyway!

Is there any material that you recommend to someone like me willing to learn programming withoul a programming background?

I feel that sometimes lack of very basic knowledge get me stuck/confused!!


Thanks a lot for you reply!
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is more about .jar files in this Java™ Tutorials section.
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic