What are command line arguments in java

Assignment Help JAVA Programming
Reference no: EM13940436

Consider the following Java program:

import java.lang.*;
public class SecondProgram {
public static void main ( String args[] ) {
if (args.length > 0) {
System.out.println("Hello " + args[0]);
} else {
System.out.println( "Hello everybody!");
}
}
}

PART 1.

Modify the program such that if there are no command line arguments, when you type:

java SecondProgram

It should give:

Hello everybody!

PART 2:

If there are command line arguments (names) then it will print Hello to all the names with one name printed per line (along with the number of the name):

When you type:

java SecondProgram Helen Armen Joseph

You should get:

Hello
1. Helen
2. Armen
3. Joseph

Reference no: EM13940436

Questions Cloud

Standard server and the ms sql standard database : In assignment 2 you will be installing Windows 2012 Standard Server and the MS SQL Standard database. In order to do this, you should have a set approach that outlines  what you need to do, how to do it, in what order and why you are doing it. You ..
Find both the growth rate of dividends and the price : Find both the growth rate of dividends and the price of the stock if the company reinvests the following fraction of its earnings in the firm: (i) 0%; (ii) 40%; (iii) 60%
Accepting the concept of corporate social responsibility : Task 1 - Individual Essay (1000 words) Topic: "Discuss critically the extent to which you accept the concept of corporate social responsibility" Student required to write a critical analysis essay based on the above topics.
What income statement items are affected by the tent sales : How do you suppose Kicker accounts for the costs of the tent sales? What income statement items are affected by the tent sales? What was the profit (loss) from the Austin tent sale?
What are command line arguments in java : Modify the program such that if there are no command line arguments, when you type:
Strategic leadership at the organisation : Discuss your leader's strategic leadership at the organisation.  This might involve discussing how well you think the leader implements and manages the strategic planning processes.  For example is it clear that the leader is involved with all six..
What is the annual holding cost : How much safety inventory of each variant must Orion keep without component commonality? What is the annual holding cost?
What kind of remedial programme would be best : Q1. As Rajat's supervisor can you find out whether the poor performance is due to poor training or to some other cause?   Q2. If you find Rajat has been inadequately trained, how do you go about introducing a remedial training programme?  Q3. If he h..
Initiated a quality improvement program : At the beginning of the year, Donjuan Company initiated a quality improvement program. The program was successful in reducing scrap and rework costs. To help assess the impact of the quality improvement program, the following data were collected f..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd