Following a tutorial on the internet regarding Soap development with Java, I found this link, with a rather unusual code for myself.
The code:
public
all classes extends the java.lang.Object by default. You can see it here
It is silly code. Every class in Java extends an Object class. No need to type this explisitly
Extends clause is optional as stated in Java Language Specification. If it is omitted, the class is derived from java.lang.Object. It is just a matter of coding style to write it or not to write it in this case. Usually it is omitted.
It's unneeded. Every class in Java extends Object at some level. Leave it out, unless you need to clarify something specific.
All objects in Java implicitly extend Object
, so I'd say it's redundant.
It is legal but useless boilerplate. Everything extends Object so the language spec allows you to leave it out, and it generally should be left out (some writers of coding standards disagree).
The situation is the same in generics (extends Object is implicit and redundant), it is just that for some reason (I have seen some claim early buggy Generics implementations had issues with the ? wildcard) it has caught on a bit more there.