A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/quizzes/java-variables/ below:

Quiz about Java Variables

Which of the following is a valid way to declare a variable in Java?

What will be the output of the following code?

Java
public class Geeks {
    public static void main(String[] args) {
        int a;
        System.out.println(a);
    }
}

Which of the following is true about variable names in Java?

What is the default value of a boolean instance variable in Java?

What will be the output of the following Java program?

Java
public class Main {
    static int x;
    public static void main(String[] args) {
        System.out.println(x);
    }
}

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

What will be the output of this code?

Java
public class Example {
    int num = 5;
    public static void main(String[] args) {
        Example obj = new Example();
        System.out.println(obj.num);
    }
}

Which of the following statements about var keyword is FALSE?

What will be the output of this Java program?

Java
public class Demo {
    public static void main(String[] args) {
        int x = 10;
        {
            int x = 20;
            System.out.println(x);
        }
    }
}

Which of the following statements is correct?

There are 10 questions to complete.

Take a part in the ongoing discussion


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4