Programming 11: Java Assesement Exam

38 Questions | Attempts: 391
Share

SettingsSettingsSettings
Programming Quizzes & Trivia

This will be the first quiz of our Programming 11 class. It will be to review basic introductory concepts covered in our Java Topics.


Questions and Answers
  • 1. 
    Choose the best definition for a Class.
    • A. 

      A group of students in a room

    • B. 

      An object definition, containing the data and function elements necessary to create an object

    • C. 

      An action for a program

  • 2. 
    Choose the best definition of an object
    • A. 

      A thing

    • B. 

      An instance of a class

    • C. 

      Something you wear

  • 3. 
    Choose the appropriate data type for this value:  "dog"
    • A. 

      Int

    • B. 

      String

    • C. 

      Double

    • D. 

      Boolean

  • 4. 
    Choose the appropriate data type for this value:  true
    • A. 

      Int

    • B. 

      Double

    • C. 

      String

    • D. 

      Boolean

  • 5. 
    Choose the appropriate data type for this value:  1
    • A. 

      Int

    • B. 

      Double

    • C. 

      String

    • D. 

      Boolean

  • 6. 
    Choose the appropriate data type for this value:  5.5
    • A. 

      Int

    • B. 

      Double

    • C. 

      Boolean

    • D. 

      String

  • 7. 
    Choose the appropriate data type for this value:  A
    • A. 

      Int

    • B. 

      Double

    • C. 

      Char

    • D. 

      String

  • 8. 
    Choose the appropriate data type for this value:  "x1"
    • A. 

      String

    • B. 

      Boolean

    • C. 

      Int

    • D. 

      Char

  • 9. 
    Choose the appropriate data type for this value:  true
    • A. 

      Boolean

    • B. 

      Int

    • C. 

      Char

    • D. 

      Double

  • 10. 
    Choose the appropriate data type for this field:   kindOfBird
    • A. 

      String

    • B. 

      Int

    • C. 

      Char

    • D. 

      Double

  • 11. 
    Choose the appropriate data type for this field:  numberOfEggs
    • A. 

      Double

    • B. 

      Char

    • C. 

      Boolean

    • D. 

      Int

  • 12. 
    Choose the appropriate data type for this field:  weightInKilos
    • A. 

      Char

    • B. 

      String

    • C. 

      Double

    • D. 

      Boolean

  • 13. 
    Choose the appropriate data type for this field: isSwimmer
    • A. 

      Double

    • B. 

      Boolean

    • C. 

      String

    • D. 

      Int

  • 14. 
    Choose the appropriate data type for this field: eggColour
    • A. 

      Boolean

    • B. 

      Char

    • C. 

      Int

    • D. 

      String

  • 15. 
    System.out.print (2+5) What is the possible out for this?
    • A. 

      7

    • B. 

      2+5

    • C. 

      (2+5)

    • D. 

      0

  • 16. 
    Int a=5, b=10, sum; sum=a+b System.out.print("The sum of two integers is:" ____) What is the correct java syntax for this:  
    • A. 

      A+b=sum

    • B. 

      +sum

    • C. 

      15

    • D. 

      A+b

  • 17. 
    An old name for Java Programming
    • A. 

      Sun Microsystem

    • B. 

      Javac

    • C. 

      Lava

    • D. 

      Oak

  • 18. 
    Which of the following always need a Capital letter ?
    • A. 

      Class names and Strings

    • B. 

      Objects and class names

    • C. 

      Fields and Strings

    • D. 

      Data types and fields

  • 19. 
    A data types that holds decimal numbers:
    • A. 

      Double

    • B. 

      Integers

    • C. 

      Boolean

    • D. 

      String

  • 20. 
    Your program file name is the same with___?
    • A. 

      Output

    • B. 

      Class Name

    • C. 

      Main String

    • D. 

      Syntax

  • 21. 
    Public class Test { static void main(String[] args) { System.out.println("Hello World"); } } What must be the file name of this java program?  
    • A. 

      Test.java

    • B. 

      Test.java

    • C. 

      Test.javac

    • D. 

      Test.javax

  • 22. 
    Public class Test { static void main(String[] args) { System.out.println("Hello World"); } Is there any syntax error for this program?  
    • A. 

      Yes, there is a Syntax error

    • B. 

      No

    • C. 

      Prrom will dispaly its output

    • D. 

      Maybe

  • 23. 
    Public class Test{ static void main(String[] args) { System.out.println("Hello World"); }} What is the correct syntax in compiling java program?  
    • A. 

      Java.Test javac

    • B. 

      Test.java.javac

    • C. 

      Javac Test.java

    • D. 

      Test.java

  • 24. 
    Public class Test{ static void main(String[] args) { System.out.println("Hello World"); }} What is the correct syntax in compiling java program?  
    • A. 

      Java.Test javac

    • B. 

      Test.java.javac

    • C. 

      Javac Test.java

    • D. 

      Test.java

  • 25. 
    What is the error in this following java program: public class Employee { public showName () { name = Walter; System.out.println ("Employee's name is: " + name); } }
    • A. 

      No data type declared

    • B. 

      Wrong format

    • C. 

      No variable name

    • D. 

      No Object type

×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.