is it possible for me to call a static method if all I know is the class?
Zork'nPalls
1
Newbie Poster
Recommended Answers
Jump to PostWell, yes, static methods can be called directly on the class by ClassName.methodName(). Is that all you needed to know or is there something more specific to your question?
Jump to PostIn addition to what Ezzaral said, in any good IDE or editor you should be able to get a list of static methods as long as you just type in the class name.
Yourreturn thing.class.getNumber(); // compile time error
is not right. You have to call …
All 7 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Zork'nPalls
1
Newbie Poster
orko
36
Junior Poster
orko
36
Junior Poster
Zork'nPalls
1
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Zork'nPalls
1
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.