Online Access Free 1Z0-501 Exam Questions
| Exam Code: | 1Z0-501 |
| Exam Name: | Java Certified Programmer |
| Certification Provider: | Oracle |
| Free Question Number: | 147 |
| Posted: | Dec 02, 2026 |
Exhibit:
1 . public class test(
2 . public int aMethod()[
3 . static int i=0;
4 . i++;
5 . return I;
6 . )
7 . public static void main (String args[]){
8 . test test = new test();
9 . test.aMethod();
1 0.int j = test.aMethod();
1 1.System.out.printIn(j);
1 2.]
1 3.}
What is the result?
Given:
1 3. public class Foo {
1 4. public static void main (String [] args){
1 5.StringBuffer a = new StringBuffer ("A");
1 6.StringBuffer b = new StringBuffer ("B");
1 7.operate (a,b);
1 8.system.out.printIn{a + "," +b};
1 9. )
2 0. static void operate (StringBuffer x, StringBuffer y){
2 1.y.append {x};
2 2.y = x;
2 3.)
2 4. }
What is the result?
Exhibit:
1 . public class X {
2 . public static void main (String[]args){
3 . int [] a = new int [1]
4 . modify(a);
5 . System.out.printIn(a[0]);
6 .}
7 .
8 . public static void modify (int[] a){
9 .a[0] ++;
1 0.}
1 1. }
What is the result?
Exhibit:
1 . class super (
2 . public int I = 0;
3 .
4 . public super (string text) (
5 . I = 1
6 .)
7 .)
8 .
9 . public class sub extends super (
1 0. public sub (string text) (
1 1. i= 2
1 2. )
1 3.
1 4. public static void main (straing args[]) (
1 5. sub sub = new sub ("Hello");
1 6. system.out. PrintIn(sub.i);
1 7.)
1 8. )
What is the result?