import java.util.Scanner; class ParseDouble{ public static double leggiDouble( Scanner tastiera ){ System.out.println( "Dammi un double" ); // Le due formulazioni seguenti si equivalgono: return tastiera.nextDouble( ); // return Double.parseDouble( tastiera.next( ) ); } public static void main( String[] aaa ) { Scanner tastiera = new Scanner(System.in ); double a = leggiDouble( tastiera ); double b = leggiDouble( tastiera ); System.out.println( a / b ); } }