uz
Feedback
Top Java Quiz Questions ☕️

Top Java Quiz Questions ☕️

Kanalga Telegram’da o‘tish

🎓🔥💾 If you want to acquire a solid foundation in Java and/or your goal is to prepare for the exam, this channel is definitely for you. 🤳Feel free to contact us - @topProQ If you are interested in Python https://t.me/topPythonQuizQuestions

Ko'proq ko'rsatish
2 880
Obunachilar
-224 soatlar
+127 kunlar
+2930 kunlar
Postlar arxiv
Code snippet: 3: byte a = 40, b = 50; 4: byte sum = (byte) a + b; 5: System.out.println(sum);

How many times will the following code print "Hello World"?
Anonymous voting

Code snippet:
3: for(int i=0; i<10 ; ) {
4: i = i++;
5: System.out.println("Hello World");
6: }

What is the output of the code snippet?
Anonymous voting

Code snippet:
3: boolean x = true, z = true;
4: int y = 20;
5: x = (y != 10) ^ (z=false);
6: System.out.println(x+", "+y+", "+z);

What is the output of the code?
Anonymous voting

Code snippet
1: public class TernaryTester {
2: public static void main(String[] args) {
3: int x = 5;
4: System.out.println(x > 2 ? x < 4 ? 10 : 8 : 7);
5: }}

What does the code output?
Anonymous voting

Code snippet:
1: public class Salmon {
2: int count;
3: public void Salmon() {
4: count = 4;
5: }
6: public static void main(String[] args) {
7: Salmon s = new Salmon();
8: System.out.println(s.count);
9: } }

Given the class above, which of the following calls print out 'Blue Jay'?
Anonymous voting

Code snippet:
public class BirdDisplay {
 public static void main(String[] name) {
 System.out.println(name[1]);
} }

What is the result of the statements?
Anonymous voting

Code snippet:
6: List<String> list = new ArrayList<String>();
7: list.add("one");
8: list.add("two");
9: list.add(7);
10: for(String s : list) System.out.print(s);

What is the output of the code?
Anonymous voting

Code snippet:
LocalDate date = LocalDate.parse("2018-04-30", DateTimeFormatter.ISO_LOCAL_DATE);
date.plusDays(2);
date.plusHours(3);
System.out.println(date.getYear() + " " + date.getMonth() + " "+ date.getDayOfMonth());

What is the result of the statements above?
Anonymous voting

Code fragment:
3: ArrayList<Integer> values = new ArrayList<>();
4: values.add(4);
5: values.add(5);
6: values.set(1, 6);
7: values.remove(0);
8: for (Integer v : values) System.out.print(v);

What is the result of the code snippet?
Anonymous voting

Code snippet:
4: List<Integer> list = Arrays.asList(10, 4, -1, 5);
5: Collections.sort(list);
6: Integer array[] = list.toArray(new Integer[4]);
7: System.out.println(array[0]);