Niveditha Daneesh 1517106058 Information Technology Wipro Talent Next 2021 OOPS - Assignment
Niveditha Daneesh 1517106058 Information Technology Wipro Talent Next 2021 OOPS - Assignment
Niveditha Daneesh 1517106058 Information Technology Wipro Talent Next 2021 OOPS - Assignment
1517106058
Information Technology
Wipro Talent Next 2021
OOPS – Assignment
1 import java.util.*;
class A{
String na;
String em;
char ge;
book.setName("JavaWorld");
System.out.println(book.getName());
String[] authDetails = book.getAuthor().toString();
for(String strr: authDetails)
{
System.out.println(strr);
}
}
}
2 import java.util.*;
public class A {
public A() {
System.out.println("A new animal has been created!");
}
public void s() {
System.out.println("An animal sleeps...");
}
public void e() {
System.out.println("An animal eats...");
}
}
public class B extends A {
public B() {
super();
System.out.println("A new bird has been created!");
}
public void s() {
System.out.println("A bird sleeps...");
}
public void e() {
System.out.println("A bird eats...");
}
}
public class D extends A {
public D() {
super();
System.out.println("A new dog has been created!");
}
public void s() {
System.out.println("A dog sleeps...");
}
public void e() {
System.out.println("A dog eats...");
}
}