Search:

Type: Posts; User: helloworld922

Search: Search took 0.11 seconds.

  1. Replies
    17
    Views
    2,462

    [SOLVED] Re: The 'new' Keyword

    That's to be expected. The reasoning is this:

    If you create a variable and never use it, it's not necessarily a problem. It's not exactly useful, but there are uses for allowing this to happen....
  2. Replies
    17
    Views
    2,462

    [SOLVED] Re: The 'new' Keyword

    No object is created, it is simply a floating reference.




    public class Test
    {
    public Object o1;
    public static Object o2;
  3. Replies
    17
    Views
    2,462

    [SOLVED] Re: The 'new' Keyword

    To clarify aussiemcgr's answer, the variable is kind of set to null. The java compiler is smart enough to recognize here that object has never been initialized and will by default throw a compile...
Results 1 to 3 of 3