| Exam Code/Number: | 1Z0-803Join the discussion |
| Exam Name: | Java SE 7 Programmer I |
| Certification: | Oracle |
| Question Number: | 216 |
| Publish Date: | Jun 14, 2026 |
|
Rating
100%
|
|
Given:
Which code fragment, when inserted at line 7, enables the code print true?
Given:
public class MainMethod {
void main() {
System.out.println("one");
}
static void main(String args) {
System.out.println("two");
}
public static void main(String[] args) {
System.out.println("three");
}
void mina(Object[] args) {
System.out.println("four");
}
}
What is printed out when the program is excuted?
Given the code fragment:
1.ArrayList<Integer> list = new ArrayList<>(1);
2.list.add(1001);
3.list.add(1002);
4.System.out.println(list.get(list.size()));
What is the result?
Given the code fragment:
StringBuilder sb = new StringBuilder ( ) ; Sb.append ("world");
Which code fragment prints Hello World?
Given:
public class TestLoop {
public static void main(String[] args) {
int array[] = {0, 1, 2, 3, 4};
int key = 3;
for (int pos = 0; pos < array.length; ++pos) {
if (array[pos] == key) {
break;
}
}
System.out.print("Found " + key + "at " + pos);
} }
What is the result?