aspose 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


Win a copy of Head First Android this week in the Android forum!
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: 235
    
    1

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


Thanks,
Sudhanshu(OCPJP,OCEJPAD)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14913
    
  26

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
 
It's not a secret anymore!