just started learning java, aint got much of a clue, well none at all really
class ReadIn { public static void main(String[] args) throws java.io.IOException {
String inputString = null; // for storing the string with a null value if it doesn't exist public int Gethour() { System.out.println("Please enter in the 24hr format the hour eg 00 - 23"); String hourstring; // for storing it as a string int hourint = 0; // for storing the integer value try { hourstring = Gethour(); hourInt = Integer.parseInt(hourString); } catch (NumberFormatException e) { System.out.println (e); hourInt = 0; } return hourInt ; } } }
any ideas why this doesnt work will be really appreciated