1. The class TestClass cannot be declared abstract 2. The variable j cannot be declared transient 3. The variable k cannot be declared synchronized 4. The constructor TestClass( ) cannot be declared final 5. The method f( ) cannot be declared static
The below link has given differences between constructors and methods which says methods cant have same name as class.
Actuallly the article doesn't say that at all.
Constructors have the same name as their class; by convention, methods use names other than the class name.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Joined: Dec 05, 2006
I executed the code successfully.As per my understanding by java convention it is not advisable to use classname as method name but it wont throw errors if we use it. [ December 19, 2006: Message edited by: nike sama ]