In.java |
package futils; import javax.swing.JOptionPane; public class In { public static String getString(Object o) { return JOptionPane.showInputDialog(o); } public static int getInt(Object o) { return Integer.parseInt(JOptionPane.showInputDialog(o)); } //public static double getDouble(Object o) { // return Double.parseDouble(JOptionPane.showInputDialog(o)); ///} public static void main(String args[]) { System.out.println( "Hello "+getString("Please Enter your class:")); System.out.println( "There are " +getInt("Please Enter the number of students:") +"Students in your class"); //System.out.println( "your grade= "+getDouble("Please Enter your grade:")); } }