• Post Reply Bookmark Topic Watch Topic
  • New Topic

Static not allowed

 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 15759
74
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!