How to call static method?

Answer Posted / maharajan j

Static methods we can call without class reference.We don't
need to create an object of that particular class.

For example:
class A{

static void disp(){
sysout("Java")
}
}
class B{

B(){
A.disp();
}

}

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between serialization and deserialization in java?

870


Can variables be used in java without initialization?

818


What is bigger kb or mb?

803


Why collection doesn’t extend cloneable and serializable interfaces?

891


Differece between class and generic class?

803


What do you mean by formatting?

753


Why scanner is used in java?

795


What is close method? How it's different from Finalize & Dispose?

810


What does  mean in regex?

784


Explain the init method?

746


What is a parameter in java?

748


What is default switch case? Give example.

794


What is return type in java?

847


Which class contains a method: cloneable or object?

781


Can we create object of inner class in java?

702