تجمع شيتات واسئلة oop
812 subscribers
345 photos
12 videos
166 files
37 links
شوفو التثبيتات واتركو لنا دعوة جزاكم الله خيرا. 🤍
Download Telegram
it is used to achieve abstraction and mulilevel inheritance in java
Anonymous Quiz
74%
interface
7%
abstract
7%
None of the above
11%
All answers are correct
interface is class
Anonymous Quiz
22%
78%
the methods declared in interface class are by
Anonymous Quiz
16%
defult interface
84%
defult abstract
ملاحظة الشيت مكتوب ان الinterface مستحيل بكون لها تنفيذ في كلاس بس في اصدارات 8.9.

قعدت تنفذ جوا عادي. بواسطة 3طرق
1. private methods
2. keyword defult
2. static methods
3
ال interface تحقق ال multiple.

بس الinheriance و abstract لا
interface&&interface

علاقة وراثة

interface&&regular class
علاقة implementation
5
interface cannot be declared as private or protacted
Anonymous Quiz
83%
17%
مقارنة مهمة
مصطلح multiple inheriance
interface names may be adjectives or nouns
Anonymous Quiz
78%
22%
+ public
- private
# protacted
4
Method is overriden not the datamembers, so runtime polymorphism can be achieved by data members
Anonymous Quiz
53%
True
47%
False
public class Person {
String name;
int age;

public Person(String name, int age) {
this.name = name;
this.age = age;
}

public void displayInfo() {
System.out.println(name + " is " + age + " years old.");
}

public static void main(String[] args) {
Person person;
person.displayInfo();
}
}

output??
public class Person {
String name;
int age;

public Person(String name, int age) {
this.name = name;
this.age = age;
}

public void displayInfo() {
System.out.println(name + " is " + age + " years old.");
}

public static void main(String[] args) {
Person person;
person. age=20;
person.displayInfo();
}
}
1
public class Person {
String name;
int age;
Person (int y, String a){
age=y;
name=a;
}


public void displayInfo() {
System.out.println(name + " is " + age + " years old.");
}

public static void main(String[] args) {
Person person=new Person(20,"M");
Person p;
p=person;
p.displayInfo();
}
}
👍42