Class method vs Object method

Can anybody tell me the advantage and disadvantage by using Class Method or Object MethodClass Method--public static void printList(){ // some code}Object Method--public void printList(){ // some code}
[299 byte] By [Hairi.Mohd] at [2007-11-25 20:43:56]
# 1
Try reposting here: http://forum.java.sun.com/forum.jspa?forumID=31
bnitz at 2007-7-4 18:24:50 > top of Java-index,Desktop,Sun Java Desktop System...
# 2

what are dvantages and disadvantages of class and object class is a meaning less question.

class methods are belonging to whole class (not separate method for each objects).

object methods are belonging to pericular object.

[code]

class TestClass{

public static void classMethod(){}

public void objectMethod(){}

public static void main(String s[]){

TestClass test1=new TestClass();

TestClass test2=new TestClass();

// Calling object method of test1

test1.objectMethod();

// Calling object method of test2

test2.objectMethod();

// Calling Class method

// No referance

classMethod();

}

Chami at 2007-7-4 18:24:50 > top of Java-index,Desktop,Sun Java Desktop System...
# 3
This forum is devoted to supporting Sun's Java Desktop System, an alternative desktop operating system. You'll probably find an answer to your question in one of the Java developer forums: http://forum.java.sun.com/forum.jspa?forumID=31
bnitz at 2007-7-4 18:24:50 > top of Java-index,Desktop,Sun Java Desktop System...
# 4
Learn from sunonline!
learn4future at 2007-7-4 18:24:50 > top of Java-index,Desktop,Sun Java Desktop System...