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

Is oracle charging for java?

0 Answers  


suppose we have an interface & that interface contains five methods. if a class implements that interface then we have to bound that to give tha definition of all five methods in that class. If we declare that class as abstract then can we call only two methods to give the deinition of that method & i don't want to give the definition of all the methods? can it possible

6 Answers   HP, Wipro,


Can we use both this () and super () in a constructor?

0 Answers  


What are thread groups?

0 Answers  


Implement a stack with push (), pop() and min() in O(1) time.

0 Answers   Amazon,






Can inner class final?

0 Answers  


How do you define a method?

0 Answers  


Say any two properties in beans?

0 Answers  


What is the purpose of the main method?

0 Answers  


How to find the index of the largest number in an arraylist java?

0 Answers  


What are encapsulation, inheritance and polymorphism?

0 Answers  


Explain about narrowing conversion in java?

0 Answers  


Categories