Object Oriented Programming (Cs504d)

20 Questions | Total Attempts: 197

SettingsSettingsSettings
Object Oriented Programming (Cs504d) - Quiz

Questions and Answers
  • 1. 
    Which is a reserved word in the Java programming language? 
    • A. 

      Method

    • B. 

      Array

    • C. 

      Reference

    • D. 

      Native

  • 2. 
    From any non-sub-class Class outside the package, which access is possible?
    • A. 

      Public

    • B. 

      Protected

    • C. 

      Default

    • D. 

      Private

  • 3. 
    What will be the output if you execute the following java code?     import java.lang.*;      class firstapp        {           static()                {                 System.out.println(“Hello world”);                 }        } 
    • A. 

      Hello world

    • B. 

      Compilation error

    • C. 

      Run time error

    • D. 

      Hello world with a warning message

  • 4. 
    Public class Test{}    What is the prototype of the default constructor? 
    • A. 

      Test()

    • B. 

      Test(void)

    • C. 

      Public Test()

    • D. 

      Public Test(void)

  • 5. 
    Which will legally declare, construct, and initialize an array?
    • A. 

      Int [] mylist={“1”,”2”,”3”};

    • B. 

      Int [] mylist=(1,2,3);

    • C. 

      Int mylist[][]={4,9,7,0};

    • D. 

      Int mylist[]={4,6,9};

  • 6. 
    Which design model lies behind the concept of object oriented programming?
    • A. 

      Top-down design

    • B. 

      Bottom-up design

    • C. 

      Both of these

    • D. 

      None of these

  • 7. 
    Which of the following is an object based language (OBL) ?
    • A. 

      Ruby

    • B. 

      Delphi

    • C. 

      Java Script

    • D. 

      Simula

  • 8. 
    In OOPs which mechanism binds data and function together ?
    • A. 

      Modules

    • B. 

      Encapsulation

    • C. 

      Class

    • D. 

      Abstraction

  • 9. 
    The Scanner class defined in which package?
    • A. 

      Utility

    • B. 

      Applet

    • C. 

      Input-output

    • D. 

      Language

  • 10. 
    Java is pure object oriented programming language because
    • A. 

      Java is Platform-independent

    • B. 

      Java is both compiled and interpreted

    • C. 

      A single line of code cannot go outside from the class

    • D. 

      None of the above

  • 11. 
    In Java >>> operator is called
    • A. 

      Left shift

    • B. 

      Right shift with zero fill

    • C. 

      Right shift

    • D. 

      Left shift with zero fill

  • 12. 
    To check which object is of which class, which of the following is used
    • A. 

      Sizeof

    • B. 

      Comma

    • C. 

      Instanceof

    • D. 

      None of the above

  • 13. 
    Which conditional statement always returns true value?
    • A. 

      If(a==1)

    • B. 

      If(a=0)

    • C. 

      If(a=1)

    • D. 

      If(1==a)

  • 14. 
    Array subscript in Java always starts at
    • A. 

      -1

    • B. 

      1

    • C. 

      0

    • D. 

      Any value

  • 15. 
    This reference is built-in reference can only used within
    • A. 

      Static function of the class

    • B. 

      Non-static function of the class

    • C. 

      Cannot be used

    • D. 

      None of the above

  • 16. 
    Object communicate with each other by sending messages in the form of
    • A. 

      Class

    • B. 

      Through inheritance

    • C. 

      Functions

    • D. 

      None of the above

  • 17. 
    Data is given less importance in
    • A. 

      Structure programming language

    • B. 

      Object-oriented language

    • C. 

      Procedural language

    • D. 

      Object based language

  • 18. 
    Which of the following is an example of procedural programming language?
    • A. 

      C++

    • B. 

      ALGOL

    • C. 

      Java

    • D. 

      Ruby

  • 19. 
    Which command disassembles a class file?
    • A. 

      Javac

    • B. 

      Javah

    • C. 

      Javap

    • D. 

      Jdb

  • 20. 
    Java supports Unicode character set which is
    • A. 

      20 bits

    • B. 

      64 bits

    • C. 

      32 bits

    • D. 

      16 bits

Related Topics
Back to Top Back to top