A console application has no graphical user interface. You can use the nongraphical classes in either WFC or the Java API to develop your application.
Note Before you use the following procedure to create a console application, close any projects that you may already have open. (On the File menu, click Close All.)
To create a console application
Note Renaming this file does not rename the associated class in the source code, and vice versa. You must manually change all instances of the old name. (Note that you can create an empty project and then add a class with the ClassMain template. This two-step process allows you to name the class before it is created.)
To view the source code that was generated, double-click Class1.java in Project Explorer. Program execution begins with the main
method.
To add code to the application
//TODO
comment inside the main
method:String str = "The quick brown fox jumped over the lazy yellow dog.";
System.out.println("The string is: " + str);
System.out.println("The length of the string is: " + str.length());
System.out.println("The substring from positions 10 to 20 is: " +
str.substring(10,20));
System.out.println("The uppercase string is: " +
str.toUpperCase());
For more information about modifying your code in the development environment, see Editing Code.
After you build your application, you can run it from either the development environment or from the command line.
To build and run your application
jview Class1
from the directory location of your project.