[5232] in java-interest

home help back first fref pref prev next nref lref last post

Re: Is 'new' really necessary?

daemon@ATHENA.MIT.EDU (Bruce Chee)
Fri Feb 2 19:59:04 1996

Date: Sat, 3 Feb 1996 07:39:52 +0700 (THAIST)
From: Bruce Chee <bruce@tech.singalab.com.sg>
To: kkobashi@ix6.ix.netcom.com
Cc: java-interest@java.sun.com
In-Reply-To: <199602020853.AAA12001@ix3.ix.netcom.com>



On Fri, 2 Feb 1996 kkobashi@ix6.ix.netcom.com wrote:

> Can someone tell me why the 'new' keyword was used in Java?
> 
> Given:
>    (a) Date d = new Date(CurrentTime);      // Java compiler likes
>    (b) Date d(CurrentTime);                 // Java compiler doesn't like
>    (c) Date d;                              // Java compiler likes
> 
......stuff deleted...
> 
> I hope you see my point. An instanciation is an instanciation.
> Why must I think about a "new" object?
> 
  I would like to do the following...without declaring any extra variables...

class Big {
  Big() {}
}

class Small extends Big {
  Small() {}
}

public class Test{
  Test() {
    Big g=new Small();
  }
}

Perhaps this is one of the reasons for having 'new'? 

Bruce Chee


> Kerry Kobashi
> Kobashi Computing
> 
> 
> -
> This message was sent to the java-interest mailing list
> Info: send 'help' to java-interest-request@java.sun.com
> 
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post