Question
Using putty connect to the IST Linux system then use the nano editor to create the following Java command line application Lab1. Pass in two
Using putty connect to the IST Linux system then use the nano editor to create the following Java command line application Lab1. Pass in two arguments from the command line when you run the Lab1.java program. For example java Lab1 FirstName LastName These two arguments get passed into the main method as a String array in the variable object named args - see the method signature below. Noticed it is a static method and does not need an object created to call it since this is the starting point for the program (how could there be any objects before it since this is the starting point). public static void main(String[] args) { Modify the main method to concatenate the two strings FirstName LastName and print them to the command line. System.out.println(args[0] + " " + args[1] + " Rocks!"); //Line Comment
compile it with the command javac Lab1.java. To run it use java Lab1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started