Create an instance of Class B:
B b=new B();
b.method();
or define an static method in Class B:
class B
{
static void staticMethod();
}
and call it like this:
B.staticMethod();
More Related Contents:
- Can't call method from class 1 in class 2 [closed]
- Java Questions! About List and Objects
- The syntax of the method [closed]
- nothing happens when i execute the code. Got my methods right? [closed]
- Is it possible to change the return value of a method in this case? [closed]
- Java Array Parameter and Array Type Metot [closed]
- String index out of range in jva
- Which overload will get selected for null in Java?
- Java synchronized static methods: lock on object or class
- Why does this Java method appear to have two return types?
- Why doesn’t Mockito mock static methods?
- Converting Integers to Roman Numerals – Java
- Should private helper methods be static if they can be static
- Set and Get Methods in java?
- Count words in a string method?
- Error: Main method not found in class Calculate, please define the main method as: public static void main(String[] args) [duplicate]
- How do I intercept a method invocation with standard java features (no AspectJ etc)?
- Can I get all methods of a class?
- How to use a variable of one method in another method?
- Compiler error : reference to call ambiguous
- If statement using == gives unexpected result [duplicate]
- Making java method arguments as final
- Varargs Java Ambiguous Call
- Java: Sending Multiple Parameters to Method [closed]
- Java Inheritance – calling superclass method
- Final arguments in interface methods – what’s the point?
- Java: How to find if a method is overridden from base class? [duplicate]
- Is it possible to find the source for a Java native method?
- How to automatically log the entry/exit of methods in Java?
- Java – Creating an array of methods