To check if a string s contains the suffix "Java", you may write
a. if (s.endsWith("Java")) ...
b. if (s.lastIndexOf("Java") >= 0) ...
c. if (s.substring(s.length() - 4).equals("Java")) ...
d. if (s.substring(s.length() - 5).equals("Java")) ...
e. if (s.charAt(s.length() - 4) == 'J' && s.charAt(s.length() - 3) == 'a' && s.charAt(s.length() - 2) == 'v' && s.charAt(s.length() - 1) == 'a') ...
ace s.lastIndexOf("Java") >= 0 does not indicate that Java is the suffix of the string.
You might also like to view...
Why should you update the metadata for your master images with changes you’ve made in Lightroom?
What will be an ideal response?
Write a test program to handle SIGBUS, SIGFPE,and SIGSEGV.I n the signal handler,use the siginfo_t structure to print the reason for the signal. In your main function, generate each of these signals without using kill(2). Describe the address stored in the si_addr ?eld of the siginfo_t structure.
What will be an ideal response?
All of the following are Gap Size modifiers EXCEPT ____.
A. Don't Close Gaps B. Close Large Gaps C. Close Medium Gaps D. Close All Gaps
You can display a code snippet to ensure you understand the syntax and requirements for a given type of statement.
Answer the following statement true (T) or false (F)