Get Ahead with Our Exam Q&A

Explore our extensive collection of questions and answers to enhance your learning experience and prepare for exams effectively

Math.random() generates a random double greater than or equal to 0.0 and less than 1.0.

Uncaught exceptions cause the program to terminate and display an error message.

A two-dimensional array is declared with two sets of square brackets, e.g., int[][] arr = new int[2][3].

The start() method initiates a new thread of execution by calling run() internally.

Char values are added as their ASCII values (97 + 98 = 195) when not concatenated with a string.

A marker interface like Serializable has no methods and is used to provide metadata to the JVM.

Immutability means that once a String object is created, its internal state (the sequence of characters) cannot be altered. Any operation that seems to modify a string actually creates a new String object.

The length() method returns the number of characters in the string. size() is used for collections like ArrayList, and length is a property for arrays.

The equalsIgnoreCase() method compares two strings lexicographically, ignoring case differences. Using == checks for reference equality (if they are the same object), not value equality.

In Java, multiplication has higher precedence than addition. So, 3 * 4 = 12, then 2 + 12 = 14.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!

    [honeypot honeypot-100]