Source code for UseTheForceExample2.java:

public class UseTheForceExample2
{
	public static void main(String args[])
	{
		// UseTheForceExample2
		String force = "Use the force, Luke!";
		String subStr = force.substring(15, 19);
		System.out.println("Substring is " + subStr);
	}
}

Output from UseTheForceExample2.java:

Substring is Luke

--- Output Ends ---

NOTE:

You are reading previously generated output. You are not currently running the UseTheForceExample2 application at the momement. You need to compile and run the source code first.

To run this program:


Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR