Results 1 to 3 of 3

Thread: instantiating an object

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    instantiating an object

    Hey,

    Is there a difference between the following two declarations?

    dim a as new someclass

    dim a as someclass = new someclass

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: instantiating an object

    Check out this thread from a couple days ago..

    http://www.vbforums.com/showthread.php?t=365160

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: instantiating an object

    The shorter version is just laziness. And it makes Inheritance less usable.

    For example

    VB Code:
    1. Dim img as Image = new Bitmap
    ...lets you take advantage of inheritance

    whereas:

    VB Code:
    1. Dim img as new Bitmap
    ...does not. (well its not as black and white as that really but its worth considering)
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width