• Post Reply Bookmark Topic Watch Topic
  • New Topic

What are the valid and invalid cases of methods with objects and classes?  RSS feed

 
Justin Robbins
Ranch Hand
Posts: 121
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand correctly the general form of using methods is like:

object.method();

and

class.method()


They way I see it is there are four combinations of applying methods, which of the combinations are valid and invalid?

classname.staticmethod();
classname.instancemethod();
object.staticmethod();
object.instancemethod();


Please explain why or why not. Could someone kindly provide the legal cases of those four in action.

Thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your answer?
 
salvin francis
Bartender
Posts: 1612
36
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Justin, Maybe you could simple try a program to test your hypothesis ?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!