| 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
|
|
|
One will compile and one will not.
|
Joanne
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
|
|
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
|
 |
 |
|
|
subject: diff bet two methods
|
|
|