24
TestLine - SCJP sample Minta feladatsor www.testline.hu v5.7.4 (2021.11.04.) 2022.03.15. 21:11:19 vendég Dátum: 2022.03.15 21:11:19 Kérdések száma: 30 kérdés Kitöltési idő: 1:09:09 Nehézség: Összetett Pont egység: +6 -2 Típus: Mindig van legalább egy jó válasz (N/1..N) Source: http://scjptest.com 1. String 1:38 Given the code. What is the output? [1] public static void main(String args[]) { [2] Object myObj = new String[]{"one", "two", "three"};{ [3] for (String s : (String[])myObj) System.out.print(s + "."); [4] } [5] } Compilation fails because of an error at line 3 A one.two.three. B An exception is thrown at runtime. C Compilation fails because of an error at line 2 D Csak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó TestLine - SCJP sample oldal 1/24 Minta feladatsor

SCJP sample minta - testline.hu

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

Dátum: 2022.03.15 21:11:19Kérdések száma: 30 kérdésKitöltési idő: 1:09:09Nehézség: ÖsszetettPont egység: +6 -2Típus: Mindig van legalább egy jó válasz (N/1..N)Source: http://scjptest.com

1. String1:38

Given the code. What is the output?

[1] public static void main(String args[]) {[2] Object myObj = new String[]{"one", "two", "three"};{[3] for (String s : (String[])myObj) System.out.print(s + ".");[4] }[5] }

Compilation fails because of an error at line 3Aone.two.three.BAn exception is thrown at runtime.CCompilation fails because of an error at line 2DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 1/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

2. Theory2:54

Given the code. What is the output?

[ 1] public class Hotel {[ 2] private int roomNr;[ 3] [ 4] public Hotel(int roomNr) {[ 5] this.roomNr = roomNr;[ 6] }[ 7] [ 8] public int getRoomNr() {[ 9] return this.roomNr;[10] }[11] [12] static Hotel doStuff(Hotel hotel) {[13] hotel = new Hotel(1);[14] return hotel;[15] }[16] [17] public static void main(String args[]) {[18] Hotel h1 = new Hotel(100);[19] System.out.print(h1.getRoomNr() + " ");[20] Hotel h2 = doStuff(h1);[21] System.out.print(h1.getRoomNr() + " ");[22] System.out.print(h2.getRoomNr() + " ");[23] h1 = doStuff(h2);[24] System.out.print(h1.getRoomNr() + " ");[25] System.out.print(h2.getRoomNr() + " ");[26] }[27] }

100 1 1 1 1A100 100 100 100 100B100 100 1 1 1C100 100 100 1 1D100 100 100 100 1ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

3. Stream1:54

When comparing java.io.BufferedWriter to java.io.FileWriter, which capability exist as a method inonly one of the two?

flushing the streamAClosing the streamBwriting a line separator to the streamCwriting to the streamDmarking a location in the streamECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 2/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

4. Collection2:38

Given the code. What is the result?

[ 1] import java.util.Collections;[ 2] import java.util.Iterator;[ 3] import java.util.LinkedList;[ 4] import java.util.List;[ 5] [ 6] public class TryMe {[ 7] public static void main(String args[]) {[ 8] List list = new LinkedList<String>();[ 9] list.add("one");[10] list.add("two");[11] list.add("three");[12] [13] Collections.reverse(list);[14] Iterator iter = list.iterator();[15] [16] for (Object o : iter) {[17] System.out.print(o + " ");[18] }[19] }[20] }

"three two one " is printedANothing is printedB"one two three " is printedCCompilation failsDAn exception is thrown at runtimeECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

5. Import1:48

Which is true? (select two)

import static java.lang.Math;Aimport static java.lang.Math.abs;Bstatic import java.lang.Math;Cstatic import java.lang.Math.*;Dimport static java.lang.Math.*;ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 3/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

6. Map3:12

Given the following code:

[ 1] import java.util.Collection;[ 2] import java.util.HashMap;[ 3] import java.util.Map.Entry;[ 4] import java.util.Set;[ 5] [ 6] public class StringToInteger {[ 7] HashMap<String, Integer> hm = new HashMap<String, Integer>();[ 8] [ 9] public void add(String a, Integer b) {[10] hm.put(a, b);[11] }[12] [13] public Set<String> getKeys() {[14] return hm.keySet();[15] }[16] [17] public [PLACE] getValues() {[18] return hm.values();[19] }[20] [21] public Set<Entry<String, Integer>> getEntries() {[22] return hm.entrySet();[23] }[24] [25] public static void main(String args[]) {[26] StringToInteger si = new StringToInteger();[27] si.add("one", 1);[28] si.add("two", 2);[29] [30] System.out.println(si.getKeys());[31] System.out.println(si.getValues());[32] System.out.println(si.getEntries());[33] }[34] }

What should be the [PLACE] on line 17?

Set<String>A

Collection<String>B

Collection<Integer>C

Set<Integer>D

Csak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 4/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

7. Hash2:43

Given the code. What is the result?

[ 1] import java.util.HashSet;[ 2] [ 3] public class HashTest {[ 4] [ 5] private String str;[ 6] [ 7] public HashTest(String str) {[ 8] this.str = str;[ 9] }[10] [11] public static void main(String args[]) {[12] HashTest h1 = new HashTest("1");[13] HashTest h2 = new HashTest("1");[14] String s1 = new String("2");[15] String s2 = new String("2");[16] [17] HashSet<Object> hs = new HashSet<Object>();[18] hs.add(h1);[19] hs.add(h2);[20] hs.add(s1);[21] hs.add(s2);[22] [23] System.out.print(hs.size());[24] }[25] }

"2" is printed.AAn exception is thrown at runtime.BCompilation fails.C"4" is printed.D"3" is printed.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 5/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

8. Theory2:28

Given the code. Which statements are true?

[ 1] public class Hotel { [ 2] [ 3] public static void book() {[ 4] //some code goes here[ 5] }[ 6] [ 7] public void cancelBooking() {[ 8] //some code goes here[ 9] } [10] }

Hotel.cancelBooking() is a valid invocation of cancelBooking()AHotel.book() is a valid invocation of book()Bmethod cancelBooking() can directly call method book()Cmethod book() can directly call method cancelBooking()DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 6/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

9. Hotel2:00

Give the code. What is the result?

[ 1] class Hotel {[ 2] public int bookings;[ 3] public void book() {[ 4] bookings++;[ 5] }[ 6] }[ 7] [ 8] public class SuperHotel extends Hotel {[ 9] public void book() {[10] bookings--;[11] }[12] [13] public void book(int size) {[14] book();[15] super.book();[16] bookings += size;[17] }[18] [19] public static void main(String args[]) {[20] SuperHotel hotel = new SuperHotel();[21] hotel.book(2);[22] System.out.print(hotel.bookings);[23] }[24] }

Compilation fails.A-1B1C2D0EAn exception is thrown at runtime.FCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 7/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

10. String2:07

Given the code. What is the result?

[1] public static void main(String args[]) {[2] Object myObj = new String[]{"one", "two", "three"} {[3] for (String s : (String[])myObj) System.out.print(s + ".");[4] }[5] }

one.two.three.AAn exception is thrown at runtime.BCompilation fails because of an error at line 3CCompilation fails because of an error at line 2DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

11. Cycle1:46

Given the code. What is the result?

[1] int i = 10;[2] while (++i <= 10) {[3] i++;[4] }[5] System.out.print(i);

Line 5 will be never reached.A12B11C10DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 8/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

12. Thread2:14

Given the code. What is the result?

[ 1] public class Cruiser implements Runnable {[ 2] [ 3] public void run() {[ 4] System.out.print("go");[ 5] }[ 6] [ 7] public static void main(String arg[]) {[ 8] Thread t = new Thread(new Cruiser());[ 9] t.run();[10] t.run();[11] t.start();[12] }[13] }

"gogogo" is printedA"gogo" is printedB"go" is printedCCompilation fails.DAn exception is thrown at runtime.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 9/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

13. Generic2:23

Given the code. What is the result?

[ 1] public class TrickyNum<X extends Number> {[ 2] [ 3] private X x;[ 4] [ 5] public TrickyNum(X x) {[ 6] this.x = x;[ 7] }[ 8] [ 9] private double getDouble() {[10] return x.doubleValue();[11] }[12] [13] public static void main(String args[]) {[14] TrickyNum<Integer> a = new TrickyNum<Integer>(new Integer(1));[15] System.out.print(a.getDouble());[16] }[17] }

"1" is printed.AAn exception is thrown at runtime.BCompilation fails.C"1.0" is printed.DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 10/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

14. Thread2:11

Given the code. What is the result?

[ 1] public class Hotel {[ 2] [ 3] private static void book() {[ 4] System.out.print("book");[ 5] }[ 6] [ 7] public static void main(String[] args) throws InterruptedException {[ 8] Thread.sleep(1);[ 9] book();[10] }[11] }

An exception is thrown at runtime.AThe code executes normally, but nothing is printed.BCompilation fails.C"book" is printedDCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 11/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

15. Overload2:30

Given the exhibit. What is the result?

[ 1] public class Hotel {[ 2] [ 3] public static void book(short a) {[ 4] System.out.print("short ");[ 5] }[ 6] [ 7] public static void book(Short a) {[ 8] System.out.print("SHORT ");[ 9] }[10] [11] public static void book(Long a) {[12] System.out.print("LONG ");[13] }[14] [15] public static void main(String[] args) {[16] short shortRoom = 1;[17] int intRoom = 2;[18] [19] book(shortRoom);[20] book(intRoom);[21] }[22] }

short LONGACompilation failsBSHORT LONGCAn exception is thrown at runtimeDCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 12/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

16. Parameter2:21

Given the code. What is the result?

[ 1] public class SomeClass {[ 2] private int value = 1;[ 3] [ 4] public int getValue() {[ 5] return value;[ 6] }[ 7] [ 8] public void changeVal(int value) {[ 9] value = value;[10] }[11] [12] public static void main(String args[]) {[13] int a = 2;[14] SomeClass c = new SomeClass();[15] c.changeVal(a);[16] System.out.print(c.getValue());[17] }[18] }

An exception is thrown at runtimeA"1" is printedBCompilation failsC"2" is printedDCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 13/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

17. Boolean2:14

Given the code. What is the result?

[ 1] public class TryMe {[ 2] [ 3] public static void printB(String str) {[ 4] System.out.print(Boolean.valueOf(str) ? "true" : "false"); [ 5] }[ 6] [ 7] public static void main(String args[]) {[ 8] printB("tRuE");[ 9] printB("false");[10] }[11] }

"truefalse" is written.AAn exception is thrown at runtime.B"falsefalse" is written.CCompilation fails.D"truetrue" is written.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

18. Theory2:29

Given the code. What is true?

[ 1] public class Room {[ 2] public int roomNumber;[ 3] private Date beginDate;[ 4] private Date endDate;[ 5] [ 6] public void book(int roomNumber, Date beginDate, Date endDate) {[ 7] this.roomNumber = roomNumber;[ 8] this.beginDate = beginDate;[ 9] this.endDate = endDate;[10] }[11] }

The variable roomNumber breaks encapsulation.AThe code demonstrates polymorphism.BThe class is fully encapsulated.CVariables beginDate and endDate break polymorphism.DThe method book breaks encapsulation.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 14/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

19. Generic2:24

Given the code. What is the result?

[ 1] public class TrickyNum<X extends Object> {[ 2] [ 3] private X x;[ 4] [ 5] public TrickyNum(X x) {[ 6] this.x = x;[ 7] }[ 8] [ 9] private double getDouble() {[10] return ((Double) x).doubleValue();[11] }[12] [13] public static void main(String args[]) {[14] TrickyNum<Integer> a = new TrickyNum<Integer>(new Integer(1));[15] System.out.print(a.getDouble());[16] }[17] }

"1.0" is printed.A"1" is printed.BAn exception is thrown at runtime.CCompilation fails.DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 15/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

20. String2:07

Given the code. What is the result?

[ 1] public static void main(String args[]) {[ 2] String str = null;[ 3] if (str.length() == 0) {[ 4] System.out.print("1");[ 5] } else if (str == null) {[ 6] System.out.print("2");[ 7] } else {[ 8] System.out.print("3");[ 9] }[10] }

"2" is printed.A"1" is printed.BCompilation fails.C"3" is printed.DAn exception is thrown at runtime.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 16/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

21. Generic2:57

Given the code. Select correct calls of methods. (Select all that apply)

[ 1] import java.util.*;[ 2] [ 3] class Empty { [ 4] }[ 5] [ 6] class Extended extends Empty { [ 7] }[ 8] [ 9] public class TryMe { [10] public static void doStuff1(List<Empty> list) {[11] // some code[12] }[13] public static void doStuff2(List list) { [14] // some code[15] }[16] public static void doStuff3(List<? extends Empty> list) {[17] // some code [18] }[19] [20] public static void main(String args[]) {[21] List<Empty> list1 = new LinkedList<Empty>();[22] List<Extended> list2 = new LinkedList<Extended>();[23] [24] // more code here[25] }[26] }

doStuff2(list1);AdoStuff2(list2);BdoStuff1(list1);CdoStuff3(list1);DdoStuff1(list2);EdoStuff3(list2);FCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 17/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

22. Thread2:22

Given the code. What is the result?

[ 1] public class Cruiser implements Runnable {[ 2] public static void main(String[] args) {[ 3] Thread a = new Thread(new Cruiser());[ 4] a.start();[ 5] [ 6] System.out.print("Begin");[ 7] a.join();[ 8] System.out.print("End");[ 9] }[10] [11] public void run() {[12] System.out.print("Run");[13] }[14] }

"BeginEndRun" is printed.A"BeginEnd" is printed.B"BeginRunEnd" is printed.CAn exception is thrown at runtime.DCompilation fails.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 18/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

23. Override2:29

Given the code. What is the result?

[ 1] class Hotel {[ 2] public int bookings;[ 3] public void book() {[ 4] bookings++;[ 5] }[ 6] }[ 7] [ 8] public class SuperHotel extends Hotel {[ 9] public void book() {[10] bookings--;[11] }[12] [13] public void book(int size) {[14] book();[15] super.book();[16] bookings += size;[17] }[18] [19] public static void main(String args[]) {[20] Hotel hotel = new SuperHotel();[21] hotel.book(2);[22] System.out.print(hotel.bookings);[23] }[24] }

-1ACompilation fails.B1C0DAn exception is thrown at runtime.E2FCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 19/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

24. Inner class2:24

Which code, inserted at line labeled "//some code goes here", allows the class Application to be compiled?

[1] class Util {[2] public enum State{ACTIVE, DELETED, INACTIVE}[3] }[4] [5] public class Application { [6] public static void main(String args[]) {[7] //some code goes here [8] }[9] }

State state = State.INACTIVE;A

State state = Util.INACTIVE;B

Util.State state = Util.State.INACTIVE;C

State state = INACTIVE;D

Csak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 20/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

25. Serialization2:42

Which piece of code will allow this class to be correctly serialzed and desirialized?

[ 1] import java.io.*;[ 2] [ 3] public class Car implements Serializable {[ 4] public int speeds;[ 5] public int wheels;[ 6] [ 7] private void writeObject(ObjectOutputStream oos) [ 8] throws IOException {[ 9] oos.writeInt(speeds);[10] oos.writeInt(wheels);[11] }[12] [13] private void readObject(ObjectInputStream ois) [14] throws IOException {[15] [Place here][16] }[17] }

this = ois.defaultReadObject();Aspeeds = ois.readInt();wheels = ois.readInt();B

wheels = ois.readInt();speeds = ois.readInt();C

ois.defaultReadObject();DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 21/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

26. String2:06

Given the code. What is the result?

[ 1] public static void main(String args[]) {[ 2] String str = null;[ 3] if (str == null) {[ 4] System.out.print("1");[ 5] } else (str.length() == 0) {[ 6] System.out.print("2");[ 7] } else {[ 8] System.out.print("3");[ 9] }[10] }

"1" is printed.AAn exception is thrown at runtime.BCompilation fails.C"3" is printed.D"2" is printed.ECsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

27. Parameter2:01

Given the code. What is the output?

[ 1] public class Test { [ 2] int a = 10;[ 3] [ 4] public void doStuff(int a) {[ 5] a += 1;[ 6] System.out.println(a++);[ 7] }[ 8] public static void main(String args[]) {[ 9] Test t = new Test();[10] t.doStuff(3);[11] }[12] }

5A12B4C11DCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 22/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

28. Thread1:42

Given the code. What is the result?

[ 1] public class Hotel {[ 2] [ 3] private static void book() {[ 4] System.out.print("book");[ 5] }[ 6] [ 7] public static void main(String[] args) throws InterruptedException {[ 8] Thread.sleep(1);[ 9] book();[10] }[11] }

The code executes normally, but nothing is printed.ACompilation fails.BAn exception is thrown at runtime.C"book" is printedDCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

29. Queue2:13

Given the code. What is the result?

[ 1] import java.util.*;[ 2] [ 3] public class TryMe {[ 4] public static void main(String args[]) {[ 5] Queue<String> q = new PriorityQueue<String>();[ 6] q.add("3");[ 7] q.add("1");[ 8] q.add("2");[ 9] System.out.print(q.poll() + " ");[10] System.out.print(q.peek() + " ");[11] System.out.print(q.peek());[12] }[13] }

3 1 1A2 3 3B1 2 3C3 2 1D1 2 2E1 1 2FCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

TestLine - SCJP sample oldal 23/24 Minta feladatsor

TestLine - SCJP sampleMinta feladatsor

www.testline.huv5.7.4 (2021.11.04.)

2022.03.15. 21:11:19vendég

30. Parameter2:12

Given the code. What is the result?

[ 1] public class SomeClass {[ 2] private int value = 1;[ 3] [ 4] public void printVal(int value) {[ 5] System.out.print(value);[ 6] }[ 7] [ 8] public static void main(String args[]) {[ 9] int a = 2;[10] SomeClass c = new SomeClass();[11] c.printVal(a);[12] }[13] }

An exception is thrown at runtimeA"2" is printedBCompilation failsC"1" is printedDCsak tipp Talán jó Nem válaszolok Valószínűleg jó Biztosan jó

Powered by TCPDF (www.tcpdf.org)

TestLine - SCJP sample oldal 24/24 Minta feladatsor