MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import javax.swing.JOptionPane;

public class MainClass {
    public static void main(String[] args) {
        String s;
        s = JOptionPane.showInputDialog("Enter an integer:");
        int x = Integer.parseInt(s);
        System.out.println("You entered " + x + ".");
    }
}