JAVA Quiz /5 Time is up!! Misc 1 / 5 What is the valid function to find the length of the string? a. ends() b. toString() c. compare() d. length() The Java String class length() method finds the length of a string. The length of the Java string is the same as the Unicode code units of the string. 2 / 5 What is the valid variable name to store a string ? a. String b. My string c. string d. Char A Java variable is a chunk of memory that can be used to store data. As a result, a variable has a data type. The text on Java data types goes through data types in greater depth. 3 / 5 What will be the output of below code: Copy Code Copied Use a different Browser class abc { public static void main(String args[]) { if(args.length>0) System.out.println(args.length); } } a. The snippet does not compile b. The snippet compiles, runs and prints 1 c. The snippet compiles, runs and prints 0 d. The snippet compiles and runs but does not print anything Explanation: As no argument is passed to the code, the length of args is 0. So the code will not print. 4 / 5 What is the default value of a character? a. a b. \u000 c. A d. /u000 A single 16-bit Unicode character is represented by the char data type. It has a value of 'u0000' (or 0) for the minimum and 'uffff' for the maximum (or 65,535 inclusive). 5 / 5 What will be the output of below code: Copy Code Copied Use a different Browser class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Quiz"); StringBuffer s2 = s1.reverse(); System.out.println(s2); } } a. QuizziuQ b. ziuQ c. ziuQQuiz d. Quiz Explanation: reverse() method reverses all characters. It returns the reversed object on which it was called. Your score is The average score is 45% 0% Exit