0
Can i extends two activity in java and please read description.
Let I have two classes one is main and other is second.If I extends a class app in main class and after that if I extends class main in class second. Will class second have all methods and non-private variable of class main and class app.
3 ответов
+ 2
Please add Java into the Relevant Tags 👍
0
yes
class App {
int a=1;
String app() {return " app\n";}
}
class Main extends App {
int m=2;
String mainx() {return " main\n";}
}
class Second extends Main {
public static void main(String[] args) {
new Second().main2();} void main2(){
System.out.println(a+app() +m+mainx());
}}