
java-language – programming-java – কুইজ মডেল টেস্ট অনুশীলন – 8
7814. Java keywords are written in lowercase as well as uppercase.
- Depends upon the program
- FALSE
- TRUE
- Depends upon the compiler
7815. Is it possible to execute some statements without main method
- Depends upon the compiler
- no
- yes
- Depends upon the program
7816. JVM stands for
- Java Very large Machine
- Java Very small Machine
- Java Virtual Machine
- Java Verified Machine
7817. Given: interface A { void x(); } class B implements A { public void x() {} public void y() {} } class C extends B { public void x() {} } And: java.util.List<A> list = new java.util.ArrayList<A>(); list.add(new B()); list.add(new C()); for(A a : list) { a.x(); a.y(); } What is the result?
- The code runs with no output.
- Compilation fails because of an error in line 20.
- An exception is thrown at runtime.
- Compilation fails because of an error in line 25.
7818. Can you compare a boolean to an integer?
- Depends upon the program
- Depends upon the compiler
- No
- Yes
7819. Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
- java.lang.Character
- java.lang.StringBuffer
- java.lang.Double
- java.lang.String
7820. Observe the following code public void foo( boolean a, boolean b){ if( a ) { System.out.println(A); } else if(a && b) { System.out.println( A&&B); } else { if ( !b ) { System.out.println( notB) ; } else { System.out.println( ELSE ) ; } } } Which is correct?
- If a is false and b is false then the output is ELSE
- If a is true and b is true then the output is A&&B
- If a is false and b is true then the output is ELSE
- If a is true and b is false then the output is notB
7821. Which is valid in a class that extends class A?
- static protected int method1(int a
- int b) { return 0; }private int method1(int a
- int b) { return 0; }public short method1(int a
- int b) { return 0; }public int method1(int a
7822. Given: public class Threads3 implements Runnable { public void run() { System.out.print("running"); } public static void main(String[] args) { Thread t = new Thread(new Threads3()); t.run(); t.run(); t.start(); } } What is the result?
- The code executes and prints "runningrunningrunning".
- An exception is thrown at runtime.
- The code executes and prints "running".
- Compilation fails.
7823. Java compiler translates Java source code into _________
- Java bytecode
- machine code
- assembly code
- another high-level language code
আমাদের কাছে থাকা লক্ষ লক্ষ মডেল টেস্ট থেকে প্রাকটিজের জন্য কিছু এখানে তুলে ধরা হল। প্রতিটি অধ্যায়ের উপরে ইশিখন.কম কুইজ চ্যালেঞ্জ এ আছে শত শত মডেল টেস্ট বার বার মডেল টেস্ট দিয়ে নিজেকে যাচাই কর এবং পুরো বাংলাদেশের সকল শিক্ষার্থীর সাথে আপনার মেধা তালিকা দেখুন। প্রশ্নে কোন প্রকার ভুল থাকলে সঠিক উত্তরসহ নিচে কমেন্ট করে জানাবেন, আমরা ঠিক করে দেবো।