Accenture Primer
Accenture DumpmediumAccenture PrimerPrimer-Dump

Accenture Accenture Primer Practice Question

class mammel{ String name= "Dog"; String makenoise(){

Answer options

A
return "Bow Wow";
B
class Cat extends mammel{
C
String name="Cat";
D
String makeNoise()
E
return "Meow";
F
public class Main{
G
public static void main (String[] args) {
H
new Main.go();
I
void go()
J
mammel m=new Cat();

Correct answer: mammel m=new Cat();

Explanation

mammel m = new Cat() — polymorphism applies to methods, not fields. m.makeNoise() calls Cat's overridden method ('Meow'). m.name accesses mammel's field ('Dog'). Output: 'Dog Meow'. Option 9 (mammel m=new Cat()) represents the polymorphic assignment that drives this behavior.

Related Accenture Accenture Primer questions

Practice more Accenture Accenture Primer questions

PrimerDumps has 1400+ primer questions, 2026 mocks and coding hands-on — all free.