Some Important Over Java Basics Questions

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Tahinenippon
T
Tahinenippon
Community Contributor
Quizzes Created: 1 | Total Attempts: 126
Questions: 6 | Attempts: 126

SettingsSettingsSettings
Java Quizzes & Trivia

This quiz tests your knowlege about Basic Java Programming


Questions and Answers
  • 1. 

    Java is 

    • A.

      A island

    • B.

      An object oriented programming language

    • C.

      A binary language

    • D.

      An assembler

    Correct Answer
    B. An object oriented programming language
    Explanation
    Java is an object-oriented programming language because it is designed to organize and structure code around objects, which are instances of classes. It supports the principles of encapsulation, inheritance, and polymorphism, allowing developers to create modular and reusable code. Java also provides features like classes, objects, methods, and interfaces to facilitate object-oriented programming.

    Rate this question:

  • 2. 

    The main method is the first executed after the constructor method executes

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because the constructor method is the first method that is executed when an object is created. The main method, on the other hand, is the entry point of a Java program and is called by the Java Virtual Machine (JVM) after the constructor method has executed.

    Rate this question:

  • 3. 

    Which is not a data type

    • A.

      Integer

    • B.

      String

    • C.

      Variable

    • D.

      Boolean

    • E.

      Character

    Correct Answer
    C. Variable
    Explanation
    The given options consist of different data types. Integer, String, boolean, and character are all valid data types. However, "variable" is not a data type itself, but rather a way to store and manipulate data of different types. Variables can hold values of various data types such as integers, strings, booleans, or characters.

    Rate this question:

  • 4. 

    A constant is declared by using the keyword

    • A.

      Int

    • B.

      Double

    • C.

      MAX

    • D.

      Final

    Correct Answer
    D. Final
    Explanation
    A constant is declared by using the keyword "final". The keyword "final" is used in Java to declare a variable that cannot be changed once it has been assigned a value. This means that the value of a final variable remains constant throughout the program. Using the "final" keyword ensures that the variable cannot be accidentally modified, providing consistency and preventing unintended changes to the value.

    Rate this question:

  • 5. 

    What does the println function do

    • A.

      Print out the program

    • B.

      Print the line of the output in the console

    • C.

      Execute a method

    • D.

      Print a statement from printer

    Correct Answer
    B. Print the line of the output in the console
    Explanation
    The println function is used to print a line of output in the console. It is commonly used in programming languages like Java or Python to display information to the user. When the println function is called, it prints the specified message or variable to the console, allowing the user to see the output of the program. This is different from simply executing a method or printing a statement from a printer.

    Rate this question:

  • 6. 

    Write a program which produce the following output The radius is 7cm PI is 3.14 Area of the circle is 38.465sqcm

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 14, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 26, 2012
    Quiz Created by
    Tahinenippon
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.