Opening the reading…
Opening the reading…
PROGRAMMING FUNDAMENTALS › C++ FUNDAMENTALS
This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.
TASK
In Java, use word = "learnyard" to print its length, emptiness, first and last characters, reassign it with a trailing period and then restore it, print the position and substring for "yard", and confirm that indexOf() and substring() did not change the restored source.
OUTPUT
Samplelength: 9 empty: false first: l last: d after adding period: learnyard. after restoring: learnyard indexOf yard: 5 substring: yard source after indexOf and substring: learnyard
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.