Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Example to Show Command-Line Arguments and Wrapper Class

Similar presentations


Presentation on theme: "An Example to Show Command-Line Arguments and Wrapper Class"— Presentation transcript:

1 An Example to Show Command-Line Arguments and Wrapper Class

2 7.12 Using Command-Line Arguments
Can pass arguments from the command line to an application. Arguments that appear after the class name in the java command are received by main in the String array args. The number of command-line arguments is obtained by accessing the array’s length attribute. Command-line arguments are separated by white space, not commas. (C) 2010 Pearson Education, Inc. All rights reserved.

3 (C) 2010 Pearson Education, Inc. All rights reserved.

4 (C) 2010 Pearson Education, Inc. All rights reserved.

5 (C) 2010 Pearson Education, Inc. All rights reserved.

6 7.10 Case Study: Class GradeBook Using a Two-Dimensional Array
In most semesters, students take several exams. Figure 7.18 contains a version of class GradeBook that uses a two-dimensional array grades to store the grades of a number of students on multiple exams. Each row represents a student’s grades for the entire course. Each column represents the grades of all the students who took a particular exam. In this example, we use a ten-by-three array containing ten students’ grades on three exams. (C) 2010 Pearson Education, Inc. All rights reserved.


Download ppt "An Example to Show Command-Line Arguments and Wrapper Class"

Similar presentations


Ads by Google