• ০০।
     import java.awt.*; class Ticker extends Component { public static void main (String [] args) { Ticker t = new Ticker(); /* Missing Statements? */ } } 
    which two of the following statements, inserted independently, could legally be inserted into missing section of this code?
    1. boolean test = (Component instanceof t);
    2. boolean test = (t instanceof Ticker);
    3. boolean test = t.instanceof(Ticker);
    4. boolean test = (t instanceof Component);
    • ক) 1 and 4
    • খ) 2 and 3
    • গ) 1 and 3
    • ঘ) 2 and 4
  • ০১।
     package testpkg.p1; public class ParentUtil { public int x = 420; protected int doStuff() { return x; } } package testpkg.p2; import testpkg.p1.ParentUtil; public class ChildUtil extends ParentUtil { public static void main(String [] args) { new ChildUtil().callStuff(); } void callStuff() { System.out.print("this " + this.doStuff() ); /* Line 18 */ ParentUtil p = new ParentUtil(); System.out.print(" parent " + p.doStuff() ); /* Line 20 */ } } 
    which statement is true?
    • ক) The code compiles and runs, with output this 420 parent 420.
    • খ) If line 18 is removed, the code will compile and run.
    • গ) If line 20 is removed, the code will compile and run.
    • ঘ) An exception is thrown at runtime.
  • ০২।
    /* Missing Statement? */ public class foo { public static void main(String[]args)throws Exception { java.io.PrintWriter out = new java.io.PrintWriter(); new java.io.OutputStreamWriter(System.out,true); out.println("Hello"); } } 
    What line of code should replace the missing statement to make this program compile?
    • ক) No statement required.
    • খ) import java.io.*;
    • গ) include java.io.*;
    • ঘ) import java.io.PrintWriter;
  • ০৩।
    /* Missing statements? */ public class NewTreeSet extends java.util.TreeSet { public static void main(String [] args) { java.util.TreeSet t = new java.util.TreeSet(); t.clear(); } public void clear() { TreeMap m = new TreeMap(); m.clear(); } } 
    which two statements, added independently at beginning of the program, allow the code to compile?
    1. No statement is required
    2. import java.util.*;
    3. import.java.util.Tree*;
    4. import java.util.TreeSet;
    5. import java.util.TreeMap;
    • ক) 1 only
    • খ) 2 and 5
    • গ) 3 and 4
    • ঘ) 3 and 5
  • ০৪। A char variable can store either an ASCII character or a Unicode character.
    • ক) True
    • খ) False
  • ০৫। A class D can be derived from a class C, which is derived from a class B, which is derived from a class A.
    • ক) True
    • খ) False
  • ০৬। A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?
    • ক) 12 bytes
    • খ) 24 bytes
    • গ) 0 byte
    • ঘ) 8 bytes
    • ঙ) 16 bytes
  • ০৭। A class‘s __________ is called when an object is destroyed.
    • ক) constructor
    • খ) destructor
    • গ) assignment function
    • ঘ) copy constructor
  • ০৮। A constructor that accepts __________ parameters is called the default constructor.
    • ক) one
    • খ) two
    • গ) no
    • ঘ) three
  • ০৯। A derived class can stop virtual inheritance by declaring an override as
    • ক) inherits
    • খ) extends
    • গ) inheritable
    • ঘ) not inheritable
    • ঙ) sealed
  • ১০। A destructor takes __________ arguments.
    • ক) one
    • খ) two
    • গ) three
    • ঘ) no
  • ১১। A file written in text mode can be read back in binary mode.
    • ক) Yes
    • খ) No
  • ১২। A float is 4 bytes wide, whereas a double is 8 bytes wide.
    • ক) True
    • খ) False
  • ১৩। A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?
    • ক) ABCD
    • খ) DCBA
    • গ) 0xABCD
    • ঘ) Depends on big endian or little endian architecture
  • ১৪। A function can be used in an expression, whereas a subroutine cannot be.
    • ক) True
    • খ) False
  • ১৫। A function cannot be defined inside another function
    • ক) True
    • খ) False
  • ১৬। A function may have any number of return statements each returning different values.
    • ক) True
    • খ) False
  • ১৭। A function returns a value, whereas a subroutine cannot return a value.
    • ক) True
    • খ) False
  • ১৮। A function that receives variable number of arguments should use va_arg() to extract arguments from the variable argument list.
    • ক) True
    • খ) False
  • ১৯। A function that receives variable number of arguments should use va_arg() to extract the last argument from the variable argument list.
    • ক) True
    • খ) False