Oracle
1Z0-829 · Question #24
1Z0-829 Question #24: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-829 to reveal the answer and full explanation for question #24. The question stem and answer options stay visible for context.
Java Object-Oriented Approach
Question
- class Item {
- String name;
- public static void display() {
- name = "Vase";
- System.out.println(name);
- }
- public void display(String design) {
- this.name += name;
- System.out.println(name);
- }
- }
- public class App {
- public static void main(String[] args) {
- Item il = new Item();
- il.display("Flower");
- }
- } Which action enables the code to compile?
Options
- AReplace 15 with item.display("Flower");
- BReplace 2 with static string name;
- CReplace 7 with public void display (string design) {
- DReplace 3 with private static void display ( ) {
Unlock 1Z0-829 to see the answer
You've previewed enough free 1Z0-829 questions. Unlock 1Z0-829 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#static methods#instance variables#scope rules#method overloading