Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using putty connect to the IST Linux system then use the nano editor to create t

ID: 3873293 • Letter: U

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 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

Explanation / Answer

Answer : -

Using IST linux Server First of all you should have to login to this servers there are two IST Service providers

You Can make one of your choice then : -

then go to computer and then Network Location now connect to your UNIX home where username(//CASA)(P:)/ is mentioned.

Now create a file nameLab1.java and write following code: -

class Lab1{

public static void main(String [] args){

String Firstname=args[0];// first inline argument is assigned to Firstname

String Lastname=args[1];//Similarly Secound Argument

System.out.println("Firstname" + "Lastname" );//both are concatenated and printed

}

}

Now use command javac Lab1.java (Mentioned in question)

and the run as java Lab1

Kindlly rate my answer and do comment if any query :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote