Results 1 to 6 of 6
  1. #1
    Unsub's Avatar
    Unsub is offline Member
    Join Date
    Jan 2010
    Posts
    30
    Rep Power
    0

    Question need clarification in this statement.

    I need some basic clarification with the following code. Please bare with me, I am still just a noob when it comes to all of this.


    When using the follwing;
    Java Code:
    variable.method()
    
    e.g. 
    
    int numberOne = 0;
    numberOne.randomMethod();
    is the 'variable' actually an object. An object that inherites all avaible methods provided by its Class and/or Parent Class(es)?

    In the instance of my example, numberOne is actually an instance of a int object?
    -or-
    Is an int actually a primitave data type. Which, correct me if I am wrong, isn't actually the same as an object?
    Last edited by Unsub; 02-26-2010 at 11:28 AM. Reason: seperated questions for easier reading.

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    843
    Rep Power
    6

    Default

    Go thru sun tutorial...
    Ramya:cool:

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Unsub View Post
    Is an int actually a primitave data type. Which, correct me if I am wrong, isn't actually the same as an object?
    Yep, ints, doubles etc are the 'primitive' types of the Java language, all the others are the 'reference' types of the language. Primitives don't have methods nor members. Arrays are a bit strange: they are objects but don't have any methods nor can they be extended.

    kind regards,

    Jos

  4. #4
    Unsub's Avatar
    Unsub is offline Member
    Join Date
    Jan 2010
    Posts
    30
    Rep Power
    0

    Thumbs down

    Quote Originally Posted by RamyaSivakanth View Post
    Go thru sun tutorial...
    a) Please, if your going to reply to my post, please try to be at least the slightest bit helpful. If you have a suggestion then pleases suggest it appropriately.
    • Provide a link
    • Read the post
    • Dont assume that I haven't already done the tutorials.


    ...I was only asking for calrification to solidify my understanding. NOT direction.

  5. #5
    Unsub's Avatar
    Unsub is offline Member
    Join Date
    Jan 2010
    Posts
    30
    Rep Power
    0

    Thumbs up

    Quote Originally Posted by JosAH View Post
    Yep, ints, doubles etc are the 'primitive' types of the Java language, all the others are the 'reference' types of the language. Primitives don't have methods nor members. Arrays are a bit strange: they are objects but don't have any methods nor can they be extended.

    kind regards,

    Jos
    b) Thank you, Jos.

  6. #6
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    843
    Rep Power
    6

    Default

    Hi,
    Very sorry If I have hurted you.
    Generally ,if you go thru sun tutorial you will get some idea regarding the fundas.That's why I told like that.

    Iam such a kind of person helps others with whatever I have.
    Ramya:cool:

Similar Threads

  1. The if Statement, need some help!
    By Keno777 in forum New To Java
    Replies: 6
    Last Post: 10-24-2009, 01:53 AM
  2. HELP! need clarification
    By ptsofathrty in forum New To Java
    Replies: 1
    Last Post: 12-16-2008, 09:02 AM
  3. Private Classes Clarification
    By justlearning in forum New To Java
    Replies: 1
    Last Post: 05-06-2008, 11:51 PM
  4. Statement or Prepared Statement ?
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-01-2007, 05:45 PM
  5. If Statement
    By aDrizzle in forum New To Java
    Replies: 4
    Last Post: 07-08-2007, 09:55 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
  •