|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
The application used by this lesson is supplied for you.
Create a file named
Count.javaon your local computer by either copying or downloading theCount.javasource code. The examples in this lesson assume that you place it in the
C:\Testdirectory.Now compile and then run the
Countapplication to see what it does. You need to specify (as an argument) the path name of a file to be read. You can download and use this sample file named data or any other file you like.
Important: For this lesson, put the data file in a directory other than the directory containing theCountapplication. The examples assume that you put the data file in theC:\TestDatadirectory. Later in this lesson you will see how an application running under a security manager cannot read a file unless it has explicit permission to do so. However, an application can always read a file from the same directory (or a subdirectory); it does not need explicit permission.A sample run is
C:\Test>java Count C:\TestData\data Counted 65 chars.
|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.