Question: Question 1 String in Java is a array class variable object Question 2 What will be the output of the following code? System.out.print(Hello); System.out.print(Hello); Hello




Question 1 String in Java is a array class variable object Question 2 What will be the output of the following code? System.out.print("Hello"); System.out.print("Hello"); Hello Hello Hello Hello Hello, Hello Hello Hello Question 3 Using the + operator on two strings in order to connect them to form one longer string is called concatenation addition Merging Combination Question 4 Which of these keywords is used to make a class ? class struct none of the mentioned int Question 5 Can character data be stored in computer memory? Yes-a primitive data type char is used to store character Yes--characters are stored in special memory No-computers can only store numbers No-computer memory can only store patterns Question 6 Which of the following shows the syntax of an assignment statement? expression - expression; variableName = expression; dataType = variableName; expression = variableName; Question 7 Which one of the following declarations is NOT correct? int start = 34, end = 99 float loan; double duty; boolean value = 12: Question 8 Which of the following is called modulo operator? % Question 9 Which of these statements is incorrect? Every class must contain a main() method main() method must be made public There can be only one main() method in a program Question 10 Which of the following is called an increment operator? ++ =+ Question 11 A Java identifier must not start with a digit, and all the characters must be letters, digits, or the underscore symbol. False Question 12 An uppercase letter is considered to be the same as lowercase letter in Java. True False Question 13 println is a method that is part of the Java language. True False Question 14 The name of the file should be the same as the name of the class. True False Question 15 Compiler or Interpreter are needed in a High-Level language to execute a program. True False Question 16 MNEMONICS is an example of a Low-Level language, but it is not Assembly Language. True False Question 17 A Compiler is a program that translates a low-level language into a high-level. True False Question 18 In Java, simple equal sign (=) means assignment operator. True False Question 19 Semicolons aim to separate classes, objects, and methods. True False Question 20 In Java, a library of classes is called the main class. True False Question 21 What will be the output of the program? String str = "One Fine Day": String val = str.substring(4.7); System.out.println(val); Question 22 What will the following write ? String str = "Hello World"; str.substring(6); System.out.println(str); Question 23 Consider the following string String hannah "Did Hannah see bees? Hannah did." What is the value returned by the method call hannah.charAt(12) Question 24 Consider the following string String hannah = "Did Hannah see bees? Hannah did"; What is the value displayed by the expression hannah.length()? Question 25 What will be the output of the program? String str = "One Fine Day"; String A = str.substring(0,3); String B = str.substring(3); System.out.println( A+B)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
