Top Java Quiz Questions ☕️
رفتن به کانال در Telegram
🎓🔥💾 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
نمایش بیشترکشور مشخص نشده استفناوری و برنامهها29 704
2 880
مشترکین
-224 ساعت
+127 روز
+2930 روز
آرشیو پست ها
Code snippet:
import java.util.Arrays;
public class Main {
public static void main(String []args){
int[] random = { 6, -4, 100, 12, 0, -10 };
int x = 12;
int y = Arrays.binarySearch(random, x);
System.out.println(y);
}
}Code snippet:
2: String s1 = "java";
3: StringBuilder s2 = new StringBuilder("java");
4: if (s1 == s2)
5: System.out.print("1");
6: if (s1.equals(s2))
7: System.out.print("2");Code snippet:
7: StringBuilder sb = new StringBuilder();
8: sb.append("aaa").insert(1, "bb").insert(4, "ccc");
9: System.out.println(sb);Code snippet:
1: public class CompareValues {
2: public static void main(String[] args) {
3: int x = 0;
4: while(x++ < 10) {}
5: String message = x > 10 ? "Greater than" : false;
6: System.out.println(message+","+x);
7: }
8: }Code snippet:
3: String s = "Hello";
4: String t = new String(s);
5: if ("Hello".equals(s)) System.out.print("one ");
6: if (t == s) System.out.print("two ");
7: if (t.equals(s)) System.out.print("three ");
8: if ("Hello" == s) System.out.print("four ");
9: if ("Hello" == t) System.out.print("five");Code snippet:
1: public class Fish {
2: public static void main(String[] args) {
3: int numFish = 4;
4: String fishType = "tuna";
5: String anotherFish = numFish + 1;
6: System.out.println(anotherFish + " " + fishType);
7: System.out.println(numFish + " " + 1);
8: } }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?
Code snippet:
public class BirdDisplay {
public static void main(String[] name) {
System.out.println(name[1]);
} }Given the classes above, what is the maximum number of imports that can be removed and have the code still compile?
Code snippet
package aquarium; public class Water { }
package aquarium;
import java.lang.*;
import java.lang.System;
import aquarium.Water;
import aquarium.*;
public class Tank {
public void print(Water water) {
System.out.println(water); } }