fa
Feedback
تجمع شيتات واسئلة oop

تجمع شيتات واسئلة oop

رفتن به کانال در Telegram
438
مشترکین
-224 ساعت
-27 روز
-1330 روز
آرشیو پست ها
الupcasting توصل في دوال الاب فقط الا اذا كان فيه override
الupcasting توصل في دوال الاب فقط الا اذا كان فيه override

ان شاءلله ميجيش ✅❌ بكرا

a process of converting one data type to another is known as Typercasting

اهي فشيت
اهي فشيت

الجواب مفروضA&&C

there are two types of polymorphism in java is
Anonymous voting

انواع الpolymorphism
انواع الpolymorphism

the most common use of polymorphism in oop occurs when a parent class reference is used to refer a child class object
Anonymous voting

polymorphism in java is a concept by which we can perform a single action in different ways
Anonymous voting

polymorphism in java a concept by which we can perform a single action in different way
Anonymous voting

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();  
    }
}

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();  
    }
}

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();  
    }
}

Method is overriden not the datamembers, so runtime polymorphism can be achieved by data members
Anonymous voting

polymorphism

دايرة بروجكت فيه جميع مفاهيم الoop. هنحاول انزلا بعدين

interface names may be adjectives or nouns
Anonymous voting

class names are noun inheriance names may be adjectives or noun
Anonymous voting

مصطلح الsubinterface