logo

Crowdly

Asistenta pentru POO

Looking for Asistenta pentru POO test answers and solutions? Browse our comprehensive collection of verified answers for Asistenta pentru POO at moodle1.ceiti.md.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

O clasă internă statică poate accesa direct doar membrii statici ai clasei exterioare.

View this question

O interfață poate fi instanțiată;

View this question

Codul de mai jos este corect? 

interface A {

    int x = 5;

    void metoda();

}

 

class B implements A {

    public void metoda() {

        x = 10;

    }

}

View this question

Ce caracteristici sunt valabile pentru clasele interne nestatice? 

89%
100%
22%
View this question

O clasă anonimă poate extinde o clasă sau implementa o interfață, dar nu ambele simultan.

View this question

  1. Ce afișează codul de mai jos?

class Externa {

    private int x = 10;

 

    class Interna {

        void afiseaza() {

            System.out.println(x);

        }

    }

 

    public void executa() {

        Interna i = new Interna();

        i.afiseaza();

    }

}

 

public class Main {

    public static void main(String[] args) {

        new Externa().executa();

    }

}

View this question

Care dintre următoarele metode sunt implementări valide ale unei metode dintr-o interfață?(A,B sau C)

interface I {

    void show();

}

 

class A implements I {

    public void show() { }    // A

    void show() { }           // B

    public void show(int x) { } // C

}

View this question

O interfață poate avea variabile de instanță (non-static).

View this question

Analiza codului – Ce afișează?

  1. Ce afișează următorul cod?

interface A { void salut(); }

 

class B implements A {

    public void salut() {

        System.out.println("Salut din B");

    }

}

 

public class Main {

    public static void main(String[] args) {

        A obiect = new B();

        obiect.salut();

    }

}

View this question

Ce tipuri de clase interne există în Java?

a) Statice

b) Nestatice (non-static inner classes)

c) Locale (în metodă)

d) Anonime

View this question

Want instant access to all verified answers on moodle1.ceiti.md?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!