File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes C / C++ and the fly likes Static not allowed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Static not allowed" Watch "Static not allowed" New topic
Author

Static not allowed

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 217

Hi All,
This may be bit elementary , but I want to know why static storage class not allowed as formal parameter , when it is perfectly ok to declare one inside that function?

Thanks
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14276
    
  21

Can you explain exactly what you mean? Do you mean that you can't use 'static' for an argument variable:

void my_function(static int value) {
// ...
}

That is indeed not allowed, because it wouldn't make sense.

What would you expect it to mean to make an argument variable static? What should happen if you could do that?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
Don't get me started about those stupid light bulbs.
 
subject: Static not allowed