int n ;
n= (int)( javax.swing.JOptionPane.showInputDialog(null,"enter a 3 digit no."));
Why does the above gives error[required int, found string] and the below one works fine ?
int n ;
n= Integer.parseInt( javax.swing.JOptionPane.showInputDialog(null,"enter a 3 digit no."));