Study

Java Quiz

  •   0%
  •  0     0     0

  • A sequence of statements that has a name, may have formal parameters, and may return a value
    method
  • True of False: An array has a fixed length.
    True
  • A sequence of four bits.
    nibble
  • What is the expected output of the following expression? 19 % (2 + 3)
    4
  • What value is stored in each of the 5 elements in the following array?
    0
  • A sequence of eight bits.
    byte
  • This type of loop has no way of ending and repeats until the program is interrupted.
    infinite loop
  • The keyword "method" is another name for ...
    function
  • Java feature, which transmit the characteristic from parent class to the child class
    Inheritance
  • What is the output for the above code segment?
    10
  • It is an access modifier used for classes, attributes, methods and constructors, making them accessible by any other class.
    public
  • What is the term that refers to a collection of related elements used to store the same type of data called?
    Array
  • It is used to define a block of code to be tested for errors while it is being executed.
    try
  • What is the alternative expression of m += n?
    m = m + n
  • It repeatedly executes a target statement as long as a given condition is true.
    while
  • It is an access modifier used for variables, methods,and inner classes. It is accessible only within the same class.
    private
  • It allows you to define a block of code to be executed if an error occurs in the try block.
    catch
  • It is used at method declaration and definition to specify that the method does not return any type.
    void
  • a sequence of characters
    String
  • It refers to an expression or variable that can have only a true or false value.
    boolean
  • What is the output of the following code segment?
    21