
java-language – programming-java – কুইজ মডেল টেস্ট অনুশীলন – 7
7804. Given: for(int i = 0; i < 3; i++) { switch(i) { case 0: break; case 1: System.out.print(one ); case 2: System.out.print(two ); case 3: System.out.print(three ); } } System.out.println(done); What is the result?
- one two three two three done
- one two done
- one two three done
- done
7805. Which of the following is incorrect about static variables?
- to 0
- A static variable is associated with the class as a whole rather than with specific instances of a class.
- nonstatic functions
- static class
7806. Given: interface Foo {} class Alpha implements Foo {} class Beta extends Alpha {} class Delta extends Beta { public static void main( String[] args ) { Beta x = new Beta(); // insert code here } } Which code inserted, will cause a java.lang.ClassCastException?
- Alphaa=x;
- Foo f = (Alpha)x;
- Beta b = (Beta)(Alpha)x;
- Foo f = (Delta)x;
7807. Which of these is specified by a File object?
- directory path
- directory in disk
- None of the mentioned
- a file in disk
7808. Which of these access specifiers can be used
- Protected
- private
- Public
- All of the mentioned
7809. Which of the following will produce an answer that is closest in value to a double, d, while not being greater than d?
- (int)Math.max(d);
- (int)Math.abs(d);
- (int)Math.min(d);
- (int)Math.floor(d);
7810. Which is a valid declarations of a String?
- String s4 = (String) ‘\ufeed’;
- String s3 = (String) ‘abc’;
- String s2 = ‘null’;
- String s1 = null;
7811. Which three form part of correct array declarations?
- public final int [ ] a
- All of these
- static int [ ] a
- public int a [ ]
7812. Given: public class Blip { protected int blipvert(int x) { return 0; } } class Vert extends Blip { // insert code here } Which method, inserted independently, will compile?
- protected long blipvert(int x) { return 0; }
- private int blipvert(long x) { return 0; }
- None of above
- private int blipvert(int x) { return 0; }
7813. classes are useful because they
- brings together all aspects of an entity in one place
- can closely model objects in the real world
- permit data to be hidden from other classes
- all of the above.
আমাদের কাছে থাকা লক্ষ লক্ষ মডেল টেস্ট থেকে প্রাকটিজের জন্য কিছু এখানে তুলে ধরা হল। প্রতিটি অধ্যায়ের উপরে ইশিখন.কম কুইজ চ্যালেঞ্জ এ আছে শত শত মডেল টেস্ট বার বার মডেল টেস্ট দিয়ে নিজেকে যাচাই কর এবং পুরো বাংলাদেশের সকল শিক্ষার্থীর সাথে আপনার মেধা তালিকা দেখুন। প্রশ্নে কোন প্রকার ভুল থাকলে সঠিক উত্তরসহ নিচে কমেন্ট করে জানাবেন, আমরা ঠিক করে দেবো।