Results 1 to 2 of 2
  1. #1
    pannix is offline Member
    Join Date
    Oct 2014
    Posts
    5
    Rep Power
    0

    Default Correct way of describing the type of instance variables

    Just learning Java. What is the correct way of describing the type of instance variables?
    It is obvious in the case of a primitive type
    Example: private int number;
    The (data)type of number is integer.

    What if the instance variable is an object or a wrapper?

    example: private Person person;

    the (data?)type of person is an object of the type/class Person?

    example: private Integer number;

    ??? No idea how to do this one.

    Thanks for your time.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: Correct way of describing the type of instance variables

    I would do it simply like this:
    Java Code:
    private X x;
    'x' is an object/variable of type 'X'.

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Reg. Instance variables
    By jmohandos304 in forum New To Java
    Replies: 14
    Last Post: 06-04-2014, 02:02 PM
  2. Instance variables
    By jwl in forum New To Java
    Replies: 2
    Last Post: 10-24-2012, 11:29 PM
  3. Replies: 2
    Last Post: 09-23-2012, 05:34 AM
  4. Instance variables
    By lala in forum New To Java
    Replies: 1
    Last Post: 01-26-2011, 04:38 PM
  5. What are Instance variables and static variables?
    By sandeshforu in forum New To Java
    Replies: 3
    Last Post: 09-09-2009, 05:48 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
  •