Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Input and display: name, univRollNo, course, sem from cmdline */
- class Cmdln{
- public static void main(String args[]){
- String name;
- Integer univRollNo;
- String course;
- Integer sem;
- try{
- name = args[0];
- univRollNo = Integer.parseInt(args[1]);
- course = args[2];
- sem = Integer.parseInt(args[3]);
- } catch(Exception e){
- System.out.println("Invalid input arguments");
- return;
- }
- System.out.println(name);
- System.out.println(univRollNo.toString());
- System.out.println(course);
- System.out.println(sem.toString());
- }
- }
Add Comment
Please, Sign In to add comment