y cant i declare method like public final static show()

Answers were Sorted based on User's Feedback



y cant i declare method like public final static show()..

Answer / srikanth

Return type of the method is missing

Is This Answer Correct ?    5 Yes 0 No

y cant i declare method like public final static show()..

Answer / karthi

Return type of the method is missing

ex:
public final static void show(){}

now it ll work.

Is This Answer Correct ?    2 Yes 1 No

y cant i declare method like public final static show()..

Answer / raghavendra singh

every method declaration must has one return type(even void)
just before their method name.without return type method has
no meaning.so add some return type also here.

that's why i can't declare method like public final static
show()

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

how to accept integer array in java

2 Answers   Tech Guru,


What is the difference in between cpp and java? Can u explain in detail?

0 Answers  


What is Marker interface in java? and what is clone?

16 Answers   Persistent, Wipro,


Which language is java?

0 Answers  


Explain the differences between public, private, protected and static?

4 Answers  






There are 2 methods in a class. Both have the same method signature except for return types. Is this overloading or overriding or what is it?

9 Answers   KPIT,


What is parsing in grammar?

0 Answers  


why ,we are using jsp and html.which one is better?

2 Answers   Photon,


What is a package in java? List down various advantages of packages.

0 Answers  


Distinguish method overloading and overriding

2 Answers   Tech Mahindra,


What does pointer mean?

0 Answers  


what is the use of declaring constructor as private?

5 Answers   Cyient, IVY Technologies, Sai Softech, Virtusa,


Categories