Sut Pat wrote:We generally use non-static method in java, but why not static methods
Fill in the Blanks :
Sut Pat wrote:Please let me know the disadvantages of making all the methods 'static' in java.
I do not know why would you want to do so ?
We make classes with methods which make sense in some context
Making all methods static would mean you are using a structural approach towards programming [in an object oriented environment]
OOPs is all about objects [and other crap ]
by the way, it still makes sense to use static methods when for example you want something to be accessible without creating objects.
Campbell Ritchie wrote:I think by "structural", Sut Pat means "procedural".
I think you mean "Salvin"
well i do not prefer the term procedural, cause even in procedural languages [like visual basic] we use classes and subroutines [and functions]
as opposed to structured languages [like C] where all functions are globally accessible and there is no concept of classes/methods
I still suspect you have the wrong nomenclature. C is not a structured programming language, but procedural (although there are object-aware extensions of C, the best-known being called C++). I am not familiar with VB, but I think it is object-oriented, if you have classes.
In C they only ever say "function" and in Java we only ever say "method".