Object Oriented Programming Using Java
Unit 1 - Basics of Java and Strings in Java
Email *
Full Name:(Format : FirstName MiddleName LastName) *
Division *
Roll No. *
Java Runtime Environment (JRE) is responsible for: *
1 point
Which of the following is NOT true about Oracle JDK and OpenJDK?
*
1 point
Naming conventions in Java are used for:
*
1 point
Which of the following is a valid Java naming convention for variables?
*
1 point
What is the recommended convention for naming constants in Java?
*
1 point
Which of the following is a valid Java class name according to naming conventions?
*
0 points
What is the naming convention for Java packages?
*
1 point
Which naming convention is commonly used for method names in Java?
*
1 point
What is the primary purpose of a Java profiler?
*
1 point
Which of the following tasks can a Java profiler help with?
*
1 point
Which of the following Java profilers is commonly used for analysing performance bottlenecks in Java applications?
*
1 point
In Java, which keyword is used to declare a variable that can be accessed and modified by any method in the same class, as well as by subclasses?
*
1 point
What is the scope of a local variable in Java?
*
1 point
Which of the following data types is NOT valid for declaring a Java variable?
*
1 point
What is the result of the expression 5 + 3 * 2 in Java?
*
1 point
Which operator is used for performing exponentiation in Java?
*
1 point
What is the result of the expression true && false in Java?
*
1 point
Which of the following operators is used to perform string concatenation in Java?
*
1 point
What is a statement in Java?
*
1 point
What is the purpose of a return statement in Java?
1 point
Clear selection
What is a block in Java?
*
1 point
Which of the following is NOT true about blocks in Java?
*
1 point
What is the scope of a variable declared inside a block in Java?
*
1 point
Which of the following statements is used to execute a block of code repeatedly as long as a condition is true?
*
1 point
In Java, which control flow statement is used to terminate the current iteration of a loop and continue with the next iteration?
*
1 point
What is the purpose of the "switch" statement in Java?
*
1 point
Which class in Java is used for reading input from the keyboard?
*
1 point
Which method is used to print output to the console in Java?
*
1 point
Which of the following is a primitive data type in Java?
*
0 points
What is the size of the "int" data type in Java?
*
1 point
Which of the following is a reference data type in Java?
*
1 point
Which of the following data types is used to store decimal numbers in Java?
*
1 point
What is an array in Java?
*
1 point
Which of the following statements declares an array of integers named "numbers" in Java?
*
1 point
How do you access elements of an array in Java?
*
1 point
What is type casting in Java?
*
1 point
Which of the following is an example of implicit type casting in Java?
*
1 point
Which operator is used for explicit type casting in Java?
*
1 point
What is the result of the expression (int) 5.5 after explicit type casting in Java?
*
1 point
When might you need to use type casting in Java?
*
1 point
Which of the following statements correctly declares a String variable named "str" in Java?
*
1 point
Required
Which method is used to find the length of a String in Java?
*
1 point
What is the purpose of the charAt() method in Java?
*
1 point
What does it mean for a string to be immutable in Java?
*
1 point
Which of the following statements demonstrates the immutability of strings in Java?
*
1 point
Required
What is the result of the following code snippet?

String str1 = "Hello";
String str2 = str1.concat(" World");
System.out.println(str1);
*
1 point
What is the result of the following code snippet?

String str1 = "Hello";
str1="Hello World";
String str2 = str1.concat(" World");      System.out.println(str1);
*
1 point
Which of the following methods can be used to modify a string in Java without creating a new string object?
*
1 point
What is the purpose of using immutable strings in Java?
*
1 point
Which of the following statements correctly declares a StringBuffer variable named "sb" with an initial capacity of 16 characters in Java?
*
1 point
What is the purpose of the append() method in the StringBuffer class in Java?
*
0 points
Which method is used to reverse the characters in a StringBuffer object in Java?
*
1 point
What is the key difference between StringBuffer and StringBuilder in Java?
*
1 point
What is the purpose of the insert() method in the StringBuilder class in Java?
*
1 point
Which method is used to delete characters from a StringBuilder object in Java?
*
1 point

What is the output of following Java program?

import static java.lang.System.*;

public class HelloWorld1 {

   public static void main(String[] args) {

       out.println("Hello, World!");      

          }

}

*
1 point
Required
What is the result of the following expression:
boolean result = (5 > 3) && (4 <= 6);
*
1 point
What is the result of the following expression:
int x = 10;
int y = 5;
int result = x++ - --y * 2;
*
1 point
Which of the following operators has the lowest precedence in Java?
*
1 point
Which of the following operators has the highest precedence in Java?
*
1 point
What is the result of the following expression in Java:
int x = 5;
int y = ++x;
*
1 point
What is the result of the following expression in Java:
int x = 5;
int y = 10 - --x;
*
0 points
What is the value of x after the following code snippet executes in Java:

int x = 5;
int y = x--;
*
1 point
Which of the following statements about pre-increment and post-increment operators in Java is true?
*
1 point
A copy of your responses will be emailed to .
Submit
Clear form
Never submit passwords through Google Forms.
This form was created inside of Dyade Family Server.