In this example we will show you how to create a variable without assigning the value, and assign the value later in Java.
Source Code
package com.beginner.examples;
public class CreateAVariable {
public static void main(String[] args) {
int i; // create a variable
i = 12; //assign the value
System.out.println(i);
}
}
Output:
12