File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes diff bet two methods 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 » Java » Beginning Java
Reply Bookmark "diff bet two methods" Watch "diff bet two methods" New topic
Author

diff bet two methods

Shishir malviya
Greenhorn

Joined: Jun 21, 2005
Posts: 25
What is the difference between these definitions

public abstract void getData();
&
public abstract void getData(void);
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
One will compile and one will not.


Joanne
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12911
    
    3

The only difference is that the first line compiles, and the second line does not. I tried it for you and it gave a compiler error:

Jesper.java:4: illegal start of type
public abstract void getData(void);
^

(note: the "^" points to "void", but the forum software eats up the spaces...).
[ September 05, 2005: Message edited by: Jesper de Jong ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Jesper de Jong:
The only difference is that the first line compiles, and the second line does not. I tried it for you and it gave a compiler error:

Jesper.java:4: illegal start of type
public abstract void getData(void);
^

(note: the "^" points to "void", but the forum software eats up the spaces...).

[ September 05, 2005: Message edited by: Jesper de Jong ]


If you use UBB tags, you can force the software to preserve your spacing. In particular, either CODE or QUOTE tags will work.

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: diff bet two methods
 
Similar Threads
Implementation of remote/local mode communication
regarding class definition
Issues With Enum
Doubt Reg: initializing Variables with method call
need packages help