1.4 and 1.5

Posted on 2005-04-13
Last Modified: 2012-05-05
I'm in a class where we are learning Java at 1.4.

Everyone is wondering if we shouldn't be doing this at 1.5.

Is release 1.5 in major use?  Are the changes significant?
Comments.  To be shared with class and instructors.

Question by:hank1
    LVL 30

    Expert Comment

    Have a look at the release-notes. A lot of features were introduced by 1.5 like generics, boxing/ un-boxing, foreach iterators, type-safe enums, etc:
    LVL 1

    Author Comment

    Seems significant.  We're studing containers right now.
    I see the montra 'no primitives' is over with.
    Wonder why we're here at 1.4.  I see release is about
    a year old.  Thanks

    ... and generics -  
    LVL 1

    Author Comment

    Is this release in wide spread use?  Or will it take
    years before it's common enough to use 'generally'.

    If you want to  ....

    Just what kind of an upgrade does the client have to
    perform to use code developed under 1.5?
    Can you just plop 1.5 classes on a 1.4 box?
    LVL 30

    Expert Comment

    >> Is this release in wide spread use?  

    Not entirey but people are switching to it.

    >> Just what kind of an upgrade does the client have to
    >> perform to use code developed under 1.5? Can you just plop 1.5 classes on a 1.4 box?

    I don't think that would work. You probably need to re-install the JRE because the VM's internal behaviour might differ too.

    Accepted Solution

    I very much appreciate the decision your teacher made. The problem is that the teacher must know the material before teaching it and I doubt that he/she has had time to fully inspect whether all the assignments will work properly in the new version of Java. I tought a course that used Java (it was more of a coding patterns/design course though... not a programming course) and this is exactly the decision we made as well. We didn't feel comfortable handing out assignments that we had not tested properly with the new Java.

    That being said, we did allow people to use Java 5 if they wanted to. We just made absolutely clear that it would be the students responsibility.

    My oppinion is that while you're in school, that's the right time to experiment and have fun with what you're doing. If you're very interested in the Java programming language I suggest you take a look at Java 5 but I would not suggest that you do so when finishing your assignments! Do it on your own free time and when/if you feel comfortable enough with it you might decide to use it for one of your assignments but realize that if it fails, it's your bad!

    If you want my opinion on whether Java 5 is likely to work on an assignment... well... that depends on the assignment. Doing simple Java applications like the ones you're likely to do in a beginners course in programming will work (the palindrome checker etc.). If, however, you're doing more complex assignments (such as a client-server application or a J2EE application) you might run into problems. Also, if you're using any external libraries (jar files) in your assignments you might have problems.

    Java 5 is not in widespread use but I believe that many startup projects are using it, projects that have not yet been put into production (that's the case with my project at least).

    Java 5 did introduce a bunch of new features such as:
        int i = 2;
        Integer a = i; //This wasn't possible in Java 2 since i is not an instance of Integer.

    foreach loops:
        Collection col = getSomeCollection();
        for( Object item : col )
        { // Iterates through all items in col using the item variable

        Collection<MyClass> col = new ArrayList<MyClass>();
        col.put( new MyClass() );
        col.put( "test" ); //this will fail since the compiler will check for the type that this collection accepts
        col.get( 0 ); //this returns a MyClass instance which will save you a lot of "casting"

    variable arguments:
        public void method( String ... args ){
            // args is actually a String[] and can be used as such:
            System.out.println( args.length );
        // The following all call the above method.
        method( "foo" );
        method( "foo", "bar" );

    In addition to such "syntax and semantics" changes, some changes were made to the JVM itself as well. For example, it is now supposed to be able to share the Java class library between JVMs, therefore reducing memory usage. This feature has been reported to be not functioning properly though.

    Well, I hope I answered your question here but one fact remains: You shouldn't be too worried about which version of Java you're using in your class. The programming language is just a tool to teach you the basics of programming. If you would "learn" Java 5 in your course, you'd have to learn a new version before you finished school because Sun will release it. So in your course... try to learn "programming" instead of a "programming language", that will prepare you much better for the real world.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    how to disable hibernate query cache 2 53
    maxMirror challenge 10 69
    java set up 1 37
    groovy example issue 10 34
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now