JEP 495 Question

Barry Burd bburd at drew.edu
Thu Nov 7 17:06:39 UTC 2024


I see that parameterless println() and readln() methods are being added 
to java.io.IO in JEP 495. I'm still wondering if there's been any 
thought to including methods like readInt and readDouble. In the early 
stage of an introduction to Java, it's common to have the student input 
int values and double values for simple examples. With the current spec, 
the best way to do this (as far as I can see) is

       var n = Integer.parseInt(readln("Enter a number"));

It seems natural to simplify this with a readInt method, and the 
addition of such a method wouldn't weigh heavily on the java.io.IO package.
Any thoughts?
   --Barry


More information about the amber-dev mailing list