+ 2
Can i extend inheritance class after main method or does it have to be before?
example class{ main{ extended class{ }}}
5 Answers
+ 6
The extends keyword an only be used at the class declaration after the class name (or after the interface's name, if there are any implemented).
So you can't use it inside a method.
But you could use it inside a class at the declaration line of a nested inner class.
+ 6
You can't have two main methods in one file. The JVM doesn't know where to start from then.
+ 6
Well... yes. If that's what you want to do. But why did write the other main method then? It's unused ;)
+ 1
ah right i think i understand, this is what i was working on anyways.
.
https://code.sololearn.com/czyYxO2P1lIB/?ref=app
0
it still works which i find odd lol. so all i need to do is move my 2nd program above first main right?