Answer:
if ( line.length() > colNum && line.charAt( colNum ) != ' ' )
System.out.println( counter + ":/t" + line );
The short-circuit operation of && means
that line.length() > colNumline.charAt( colNum )colNum
Substrings
A substring of a string is a sequence of characters from the original string. The characters are in the same order as in the original string and no characters are skipped. For example, the following are all substrings of the string "applecart":
apple cart pple e lecar
You have previously seen (in chapter 9) the substring() method of String objects:
public String substring(int beginIndex )
This method creates a new substring that consists of the characters
from character number beginIndex to the end of the string.
For example
"applecart".substring(5)
contains the characters "cart" .
Remember: character numbering starts with zero.
The leftmost character of a string is character zero.
The rightmost character is character length-1.
QUESTION 18:
What is printed by the following code:
String source = "applecart"; String sub = source.substring(6); System.out.println( sub ); System.out.println( source );