How are the variables declared?

Ans: Variables can be declared anywhere in the method definition and can be initialized during their declaration.They are commonly declared before usage at the beginning of the definition. Variables with the same data type can be declared together. Local variables must be given a value before usage.

What are variable types?

Ans: Variable types can be any data type that java supports, which includes the eight primitive data types, the name of a class or interface and an array.

How do you assign values to variables?

Ans: Values are assigned to variables using the assignment operator =.

What is a literal? How many types of literals are there?

Ans: A literal represents a value of a certain type where the type describes how that value behaves. There are different types of literals namely number literals, character literals, boolean literals, string literals,etc.

What is an array?

Ans: An array is an object that stores a list of items.

How do you declare an array?

Ans: Array variable indicates the type of object that the array holds.
Ex: int arr[];

Google