Online Test Maker: AI-powered
  • Contact
  • Blog
  • How to create a test
  • Create Test →

    Company

    Privacy Policy

    Terms of Service

    GetCheap Chrome Extension

    Try Now

    Create an Online Test →

    Install for iOS

    Install for Android

    Browse All Tests

    Browse English Tests

    Knowledge

    Blog

    Contact

    Report a Bug

    Request A New Feature

    Join The Newsletter

    © Copyright 2024 Online Test Maker: AI-powered

    1. Homepage>
    2. Browse All Tests>
    3. Computer Science Tests>
    4. java computer science test

    java computer science test

    No Description

    Created on 6th January 2025

    What is the correct way to declare a variable in Java?

    What will be the output of the following code: 'System.out.println(Math.abs(-5));'

    Which of the following statements correctly uses an if-else statement?

    What is the output of the following code: 'int a = 5; int b = 10; System.out.println(a + b);'

    Which of the following is a correct way to use the Math.sqrt() function?

    How do you initialize a variable with a floating-point number in Java?

    What will be the result of the following code: 'int x = 8; if (x % 2 == 0) { System.out.println('Even'); } else { System.out.println('Odd'); }'

    What does the following code snippet do? 'double result = Math.pow(2, 3);'

    What will the following code output: 'int x = 5; x += 3; System.out.println(x);'

    Which of the following will NOT compile in Java?

    Congratulations!

    You have answered 0 out of 10 questions correctly.

    Your score is 0.00%.