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

What is use of inner class in java?

0 Answers  


Write a program to print count of empty strings in java 8?

0 Answers  


Explain about the performance aspects of core java?

0 Answers  


What is bufferedwriter?

0 Answers  


Features of JAVA ? In which version of java synchronizedXXX() methods are included in Collections class.

1 Answers   NIIT,






How does compareto method work?

0 Answers  


What do you understand by garbage collection in Java? Can it be forced to run?

0 Answers   TCS,


what is the meaning of java.lang and java.util

6 Answers  


What is array list in java?

0 Answers  


what is the use of clone method? why user cant overwrite in sub class without its proper defination.

2 Answers   TCS,


What is the difference between the ">>" and " >>>" operators in java?

0 Answers  


2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?

0 Answers   RBS, TCS,


Categories