aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Method signature Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Method signature" Watch "Method signature" New topic
Author

Method signature

Ashok Paulraj
Ranch Hand

Joined: Jul 07, 2003
Posts: 78
Is this method signature wrong ?
public synchronized void amethod(void){ }
I tried that, can't we optionally add void if we don't pass any arguments ???..I guess we could do it in C++ !!
~ Shalini
David Hadiprijanto
Ranch Hand

Joined: Sep 14, 2003
Posts: 52
I don't think you can do that.
See
JLS 8.4.1 Formal Parameters :

If a method or constructor has no parameters, only an empty pair of parentheses appears in the declaration of the method or constructor.
Ashok Paulraj
Ranch Hand

Joined: Jul 07, 2003
Posts: 78
Thanks David !!!
~ Shalini
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Method signature
 
Similar Threads
Overriding question
method-signatur for actionListener
Can a private method be final ??
exception in main thread