Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
hard Solved by 10 students

Static Vs Instance Method Calls

< Prev
Next >

What is printed as a result of executing the following code segment?

class Alpha {
    static String staticMethod() { return "Alpha"; }
    String instanceMethod() { return "alpha"; }
}
class Beta extends Alpha {
    static String staticMethod() { return "Beta"; }
    String instanceMethod() { return "beta"; }
}
public class Test {
    public static void main(String[] args) {
        Alpha a = new Beta();
        System.out.print(a.staticMethod() + " " + a.instanceMethod());
    }
}
A

Beta beta

B

Alpha alpha

C

Beta alpha

D

Alpha beta

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question
Mark for review

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1songqiuhui201211 0m 10s 90
#2patrickmeijer00911 0m 20s 80
#3geethasailaja12 0m 41s 49
#4leftoverjluck12 0m 41s 49
#5parth.taur22711 1m 28s 12
#6y.seong202712 1m 24s 6
#7znasibli101 0m 00s -10
#8kazvin.tjakradinata01 0m 19s -29
#928yokotak01 0m 21s -31
#10701704613 2m 05s -45
Items per page:
10
1 – 10 of 16
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|FAQ