Java Tutorial 16 - Command Line Arguments - Study Viral
This video show you the use of Command Line Arguments with some Wrapper Class functions like parseInt(), parseDouble(), etc.
Command Line arguments are used to pass String values to Java programs at runtime.
www.studyviral.in
info@studyviral.in
class CommandLine{ //www.studyviral.in public static void main(String []studyviral){ String a = studyviral[0]; String b = studyviral[1]; System.out.println(a); System.out.println(b); System.out.println(a+b); /*int c = Integer.parseInt(a); int d = Integer.parseInt(b); System.out.println(c+d); */ double c = Double.parseDouble(a); double d = Double.parseDouble(b); System.out.println(c+d); } }
0 comments:
Post a Comment