Why java is not a pure object oriented language?
Answer Posted / java&
public class Main {
public static void main(String[] args) {
new A().path1.fun6();
new A().path2.fun4();
new F().path1.fun1();
new I.C().path1.path2.path2.path2.fun4();
}
}
class A extends F
{
void fun1()
{
System.out.print("Class A");
}
}
class B extends A
{
void fun2()
{
System.out.print("Class B");
}
}
interface I
{
C path1=new C();
class C extends B
{
void fun3()
{
System.out.print("Interface I");
}
}
}
interface J
{
D path2=new D();
class D extends B
{
void fun4()
{
System.out.print("Interface J");
}
}
}
class E implements I,J
{
void fun5()
{
System.out.print("Interface J");
}
}
class F extends E
{
void fun6()
{
System.out.println(" class F");
}
}
/* What is this? */
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
how we can create packages in java?
What is return in java?
List primitive java types?
How will you print number in reverse (descending) order in BST.
Is vector ordered in java?
How do you define a singleton class?
Can we sort hashmap in java?
What is close method? How it's different from Finalize & Dispose?
How can you set the applet size?
Why is serialization required?
How many types of the indexof method are there for strings?
What is yield () in java?
What is difference between stringbuffer and string?
Can we have return statement in finally clause? What will happen?
Are strings immutable in java?