Ask Experts Questions for FREE Help !
Ask
    almslool's Avatar
    almslool Posts: 2, Reputation: 1
    New Member
     
    #1

    Mar 31, 2009, 05:13 AM
    Difference of calling methods?
    hello everyone,

    I am a very beginner java user and I have some doubts:

    1- see these examples:

    Weight weightObject = new Weight();
    weightObject.getWeight();

    or

    Point myPoint = new Point();
    myPoint.setX();
    myPoint.setY();


    The above examples the method is called from an object!!!

    2- see these examples:
    String number;
    int num =Integer.parselnt(number);

    or

    JOptionPane.showMessageDialog(null,"Message", JOptionPane.ERROR_MESSAGE);

    * here JOptionPane and Integer are both classes and methodes (parselnt and showMessageDialog) are methodes called from the class


    MQ is:

    What is the difference between calling a method from an object and calling a method from the class?Why do we have these two types of methods??

    wating for your answers guys... I really need it^_^

    thanks in advance.
    Perito's Avatar
    Perito Posts: 3,139, Reputation: 150
    Ultra Member
     
    #2

    Apr 5, 2009, 10:27 AM

    Class methods are "static" methods, as opposed to "instance" methods.

    Java: Static/Class methods
    almslool's Avatar
    almslool Posts: 2, Reputation: 1
    New Member
     
    #3

    Apr 7, 2009, 01:58 PM

    Thank u so much buddy

    That was very usifull

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Marie, I hear you calling, Marie the night is falling,Marie will you keep calling me [ 2 Answers ]

"Marie, I hear you calling, Marie the night is falling, Marie will you keep calling me" Every time the word"calling" is sung, it's held and rises. Any hints re anything? Title, artist, lyrics? Probably early 1950s.

Accounting methods [ 2 Answers ]

Post your response to the following: The Ritz Manor is a popular seaside resort. A Double room costs $220 for one night. In order to reserve a room, guests must pay one Night’s stay in advance. On each floor of the hotel, Vendalite Company operates vending Machines with energy bars,...

Methods [ 2 Answers ]

Could anyone please help me to find the following: drawing tests and those ones on determination of the meaning of life and death to conduct the research into psychology of gender in family man and woman, as well as self-appraisal measures (Budassi?), semantic differences method (Individual...


View more questions Search