Unit 3 Topic 4 Java Interfaces To HDFS
Unit 3 Topic 4 Java Interfaces To HDFS
//Class B Code
1package multiple;
2class B{
3 void msg(){System.out.println("Welcome");}
4}
// Class C Code
package multiple;
class C extends A,B{ // This will not be accepted by Java, It will throw an error and
1
code will not be executed.
2
public static void main(String args[]){
3
C obj=new C();
4
}
}
Conti…
Output:
Error. This particular approach throws an exception.
Java do not support Multiple inheritances. This error is
known as Diamond Problem
//Class Code
1package MIS;
2public class classA implements solution {
3 public void Hello() {
4 java.lang.System.out.println("Hello world");
5 }
6 public void Welcome() {
7 java.lang.System.out.println("Welcome to ABES");
8}
9public static void main(String[] args) {
10 classA Edureka = new classA();
11 Edureka.Hello();
12 Edureka.Welcome();
13 }
14}
Conti…
Output:
Hello World
Welcome to ABES