package start6_2; import java.util.Scanner; public class HelpingHelper { public static void main(String[] args) { Scanner in = new Scanner(System.in); double usefulInfo = obtainDouble(in); System.out.println("You entered: "+usefulInfo); } /** * * @param in * @return */ private static double obtainDouble(Scanner in) { System.out.println("Please enter a positive double: "); double result = in.nextDouble(); if(result <= 0) { System.out.println("I just can't take it any more!!"); System.exit(1); } return result; } }