The Source for Java Technology Collaboration
User: Password:



John D. Mitchell's Blog

J2SE v1.5 'Tiger' beta 1 release

Posted by johnm on February 04, 2004 at 09:34 PM | Comments (8)

Sun has released J2SE v1.5 beta 1. Go wild!


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Eclipse and JSK 1.5
    JDK 1.5 can be tested within Eclipse with this early access plugin : http://www.genady.net/forum/viewtopic.php?t=31&sid=f9aebf4a34651debb44e03b72bed1c8e

    Posted by: dgageot on February 05, 2004 at 04:46 AM

  • So far so good
    Just been looking at the demos. The start up time is 1 sec on my 1Ghz WinXP with 512Mb, and about 2 secs on my work PC. Time to play around and see if I can break it. Also time to see if the code I wrote with the generics 2.2 pre-release will work.

    Posted by: wgauvin on February 05, 2004 at 06:58 AM

  • Generics question
    Ok, I've been looking at the generics and I just can't quite wrap my mind around something. I'm looking at the Collections.java implementation, which has the following line:

    private interface SelfComparable extends Comparable {}

    Ok, so we want a comparable interfact that only can compare things of SelfComparable. Is that right?

    But...NOTHING in Collections implements it, yet some methods (min/max) expect things of type comparable. I'm completely baffled how, if nothing implements SelfComparable, how any SelfComparable objects get created. It's a private interface, so other classes aren't implementing it, and there's no reflection in Comparable that creates one.

    Anyone?

    Posted by: ckessel on February 09, 2004 at 08:37 AM

  • Generics question
    Grr, we desperately need an "edit" ability. I meant to say some methods (min/max) expect things of type *SelfComparable*.

    Posted by: ckessel on February 09, 2004 at 08:39 AM

  • Generics
    I tried JDK1.5beta and confused about Generics.

    I thought this might work, but didn't.

    public static > void sort(T[] a)

    this worked...

    public static > void sort(T[] a)

    Why is there a such incompatibility with an usual class definition?

    By the way, I prefer Generics parameter to be placed next to the function's name. (like C++)

    public static void sort > (T[] a)

    Thank you.

    Posted by: whiterabbit on February 09, 2004 at 08:38 PM

  • Generics
    Next one.

    This code cannot be compiled (with error message "you cannot use built-in array for generics type") even if the commented out "Integer" version works.

    I really love new Swing L&F "Ocean", and likes extended for-loop, but I think Generics might be too early for JDK1.5. It's very confusing. And once it's introduced, we cannot go back.

    import java.util.*;

    class Hoge> implements Comparable>
    {
    private T _value;

    public Hoge(T value)
    {
    _value = value;
    }

    public int compareTo(Hoge h)
    {
    return _value.compareTo(h._value);
    }

    public String toString()
    {
    return String.valueOf(_value);
    }
    }

    class MeApp
    {
    public static void main(String[] args)
    {

    Hoge[] a = new Hoge[] {
    new Hoge(4),
    new Hoge(1),
    new Hoge(3)
    };
    /*
    Integer[] a = new Integer[] {
    new Integer(4),
    new Integer(1),
    new Integer(3)
    };
    */
    Arrays.sort(a);

    for (Hoge x : a)
    {
    System.out.println(x);
    }
    /*
    for (Integer x : a)
    {
    System.out.println(x);
    }
    }
    */
    }

    Posted by: whiterabbit on February 09, 2004 at 09:12 PM

  • Generics
    Sorry, I didn't read specification and forgot this is beta.

    I tried one experiment.

    I implemented sort algorithm in "Lib.java" and use it in "Client.java".

    # Lib.java
    public static > void sort(List list)

    After compiling them, change interface like this and compiled only "Lib.java".

    public static > void sort(List list)

    But still worked. I'm not familier with Java Generics yet, but this might be bettern than I thought...

    Posted by: whiterabbit on February 10, 2004 at 01:34 AM

  • Generics Tutorial
    Check out Gilad's Generics Tutorial.

    Posted by: johnm on February 17, 2004 at 08:32 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds