Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  View Answers    Answer this question    Ask a question  
 

almslool
Mar 31, 2009, 05:13 AM
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^_^

Thanx in advance.

Perito
Apr 5, 2009, 10:27 AM
Class methods are "static" methods, as opposed to "instance" methods.

Java: Static/Class methods (http://leepoint.net/notes-java/flow/methods/50static-methods.html)

almslool
Apr 7, 2009, 01:58 PM
Thank you so much buddy

That was very usifull