Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Midterm 5-part 2 26. All the methods in the Math dass are static methods. True F

ID: 3867587 • Letter: M

Question

Midterm 5-part 2

26. All the methods in the Math dass are static methods. True False 27. The String concat0 method concatenates only String data types. True False 28. The String class must be imported using java.lang.String C True O False 29. What is the output? public static void main(String args) String alphaNumeric = "Java World!" + 8; System.out.println(alphaNumeric) OCompilation error Java World18 OJava World! 8 Java World! 8 30. The replaceFirstO method replaces only the first occurrence of matching character pattern in a string. True O False

Explanation / Answer

26) True

                The methods in the math class are static because, these methods do not rely on instance variables of the math class.

27) True

                The String concat() method concatenates the string to the end of the first string.

28) True

                The java.lang.String class provides many methods to work on string.

                Like toUpperCase(), toLowerCase()

29) D

                The output will be “Java World! 8”

                alphaNumeric is a string, so it can concatenate 8 with the java world!

30) True

                The method replaceFirst() will replace the first pattern that matches with the given pattern with given replacement.

[Note: Post remaining Questions separately]