Duvida na resposta

1 resposta
P

Olá pessoal estou estudando pra certificação e estou em duvida na resposta da pergunta abaixo :

Por que o item A para zero já que existe quatro declaração essa é minha duvida ?

Se alguem puder me ajudar agradeceria …abs

Section 1: Declarations, Initialization and Scoping > Objective 1.2 > Question 3 

Given: 

1. abstract class Color {
2.   protected abstract String getRGB(); 
3. }
4. 
5. public class Blue extends Color {
6.   // insert code here
7. } 

And four declarations: 

    public String getRGB() { return "blue"; }
    String getRGB() { return "blue"; } 
    private String getRGB() { return "blue"; }
    protected String getRGB() { return "blue"; }

How many, inserted independently at line 6, will compile?


A) 0
B) 1
C) 2
D) 3 
E)  4

1 Resposta

BrunoBastosPJ

Não entendi muito bem sua pergunta, porém se a pergunta for: Porque existe a opção 0 se tenho 4 métodos a resposta seria, por que ele está perguntando quantos compilariam se fossem inseridos independentemente.

Criado 24 de abril de 2006
Ultima resposta 24 de abr. de 2006
Respostas 1
Participantes 2