+ 2
Can we make a class having implemented methods as an abstract class!?
abstract class Myclass { public static int add(int a,int b) { return a+b; } public static int sub(int a,int b) { return a-b; } }
5 Respostas
+ 8
Do you mean like this?
https://code.sololearn.com/cOWJgnMX10gY/?ref=app
Just note that abstract methods cannot be static as well.
+ 5
Notice how in Denise Roßberg 's code the concrete class MyCalc did not even have to be instantiated as the members of the abstract base class were static.
+ 3
Do you mean something like this?
https://code.sololearn.com/cvsrxiYqotGs/?ref=app
Eshu Kamisetty
Edit: I added an abstract class which extends myClass
+ 2
https://code.sololearn.com/cBpjnoYQ7oaf/?ref=app
Please refer my code for answer
+ 1
I am expecting subclass which implements all methods of abstract class, main method in it.
And is the abstract class valid?