What is the output:

import java.util.Scanner;
public class Simple
{
int a;
Scanner sc=new Scanner(system.in);
void read()
{
System.out.println("Enter the value of a");
a=sc.nextint();
}
void print()
{
System.out.println("value of a="+a);
}
public static void main(String args[ ])
{
HelloWorld h= new HelloWorld();
h.read();
}

Take a=4
If Output is error mention them.

Posted on by