Checks if two strings have the same characters in the same order (case-sensitive).
What does the compareTo() method do?
Compares two strings lexicographically (alphabetical order).
What is an external library?
A collection of pre-written code for common tasks.
What is an API?
A set of functions and procedures that allow the creation of applications which access the features or data of an operating system, application, or other service.
What is the purpose of Java documentation?
To list available methods and how to use them for a Java class, library, or API.
What is the java.lang package?
A package in Java that contains core classes; classes in this package are automatically imported.
What are the differences between equals() and compareTo()?
equals() checks for content equality (boolean), compareTo() checks lexicographical order (int).
What are the differences between substring(int beginIndex, int endIndex) and substring(int beginIndex)?
The first extracts a substring between two indices, the second extracts from a start index to the end of the string.
Why is string manipulation important?
It allows you to process, modify, and extract information from text data.
What is the significance of zero-indexing in Java?
It affects how you access characters and substrings within a string.
How does equals() differ from using == for string comparison?
equals() compares the content of the strings, while == compares the memory addresses.
What does lexicographical order mean?
Alphabetical order, considering character encoding (e.g., ASCII or Unicode).
What is the purpose of using external libraries and APIs?
To extend Java's capabilities with pre-written code, saving time and effort.
Why is understanding Java documentation important?
It provides essential information on how to use classes, methods, and APIs correctly.
How do you access the nth character of a string?
Use str.substring(n-1, n) due to zero-indexing.
What is the return type of the length() method?
int
What is the return type of the equals() method?
boolean
What is the return type of the compareTo() method?