O GoConqr está de visual novo! Conte para nós o que você achou.

Quiz

Week 5 Inheritance, Polymorphism, and Interfaces

Troy Bowlin 4 perguntas Atualizado em 11 out 2016

Fazer o quiz

Perguntas do quiz (4)

  1. 1A class that is NOT abstract is said to be?
    1. Aconcrete
    2. Bprivate
    3. Cprotected
    4. Dpolymorphic
  2. 2Suppose a class has public visibility and defines a protected method.
    Which of the following statements is correct?
    1. AThis method is only accessible from inside the class itself and from inside all subclasses.
    2. BIn a class, you cannot declare methods with a lower visibility than the visibility of the class in which it is defined.
    3. CFrom within protected methods you do not have access to public methods.
    4. DThis method is accessible from within the class itself and from within all classes defined in the same package as the class itself.
  3. 3In the following code, which method is the constructor?
    public class theDemo{
    in val 1'
    int val2;
    public int Demo1(){
    val1 = 1;
    }
    public int Demo2(){
    val2 = 2;
    }
    public void the Demo(){
    val1 = 0;
    val2 = 0;
    }
    public void showDemo(){
    System.out.println(val1);
    }
    }
    1. ADemo1()
    2. BDemo2()
    3. CtheDemo()
    4. DshowDemo()
  4. 4Consider the following code. What will the output of the code be?
    import java.io.*;
    public class myStuff
    {
    static int num1 = 0;
    int num2;
    public static void main(String a{}) throws Exception
    {
    mystuff s1 = new myStuff();
    s1.num1 = 5;
    s1.num2 = 10;
    myStuff s2 = new myStuff();
    s2.num1 = 15;
    s2.num2 = 15;
    System.out.println("s1 num1=" +s1.num1+ " num2=" +s1.num2+" s2num1=" +s2.num1+" num2=" +s2.num2);
    }
    }
    1. As1 num1= 15 num2=10 s2 num1=15 num2=15
    2. Blkj

Informações

Descrição
Quiz sobre Week 5 Inheritance, Polymorphism, and Interfaces, criado por Troy Bowlin em 10-10-2016.
Idioma
English
Visualizações
1
Histórico
Criado em 10 out 2016 · atualizado em 11 out 2016
Avaliação
Ainda sem avaliações
Avalie este quiz
Avalie este quiz

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?