Results 1 to 2 of 2
  1. #1
    brocksoffice is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Java - Object Variable Type Disambiguation

    I'm finally starting to get a hold on OOP. My question is that if I have code like OOPTest t = new OOPTest(); is this a valid use of the object type? Will the object type always be the same name as the class constructor method? What determines what the Object type needs to be?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Java - Object Variable Type Disambiguation

    The type of the variable on the left needs to be either the same type or a parent type of the type on the right.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 1
    Last Post: 01-09-2012, 04:46 PM
  2. Accessing an object from within another object from the same type in Java
    By mhasgari in forum Threads and Synchronization
    Replies: 5
    Last Post: 06-20-2011, 04:21 PM
  3. Replies: 2
    Last Post: 06-01-2011, 09:44 AM
  4. using instanceof to get Object type and parent type?
    By xcallmejudasx in forum New To Java
    Replies: 2
    Last Post: 11-06-2008, 06:24 PM
  5. Creating object of Type Object class
    By venkatv in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 03:33 PM

Posting Permissions

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