I'm creating a program as an exersize which is supposed to take command-line arguments and print out their values.
Here is my code:
class InputDataTypes { public static void main(String args[]); Boolean a = Boolean.valueOf(args[0]); Character b = Character.valueOf(args[1]); Byte c = Byte.valueOf(args[2]); Short d = Short.valueOf(args[3]); Integer e = Integer.valueOf(args[4]); Long f = Long.valueOf(args[5]); Float g = Float.valueOf(args[6]); Double h = Double.valueOf(args[7]); System.out.println(a); System.out.println(b); System.out.println(c); } }
These are the error messages I'm receiving:
InputDataTypes.java:11: error: <identifier> expected
System.out.println(a);
^
InputDataTypes.java:11: error: <identifier> expected
System.out.println(a);
^
InputDataTypes.java:12: error: <identifier> expected
System.out.println(b);
^
InputDataTypes.java:12: error: <identifier> expected
System.out.println(b);
^
InputDataTypes.java:13: error: <identifier> expected
System.out.println(c);
^
InputDataTypes.java:13: error: <identifier> expected
System.out.println(c);
^
InputDataTypes.java:15: error: class, interface, or enum expected
Every single print method is giving an error. I'm not sure why this is happening.