Question
A Java method tries to get the length of an array and a
string. public class LengthChecker {   public void checkLengths() {     String[] names = {"Alice", "Bob"};     String greeting = "Hello";     System.out.println("Array length: " + names.length()); // Potential bug here     System.out.println("String length: " + greeting.length); // Potential bug here   } } What will happen when checkLengths() is executed?Solution
Correct Answer: C (In Java, arrays use .length (a field), while String objects use .length() (a method). The code swaps these, leading to compile-time errors.)
Under Section 66, if the person summoned cannot be found, service may be made by
Which of the following is not a ground on which a Data Principal may withdraw consent under the Digital Personal Data Protection Act, 2023?
Is a settlement agreement reached through community mediation enforceable as a civil court decree under The Mediation Act, 2023?
What does Explanation (b) under Section 2(28) say about persons in possession of a public servant’s position?
According to Sales of Goods Act, 1930 which of the following accurately describes the legal effect of a person, who has sold goods but continues to pos...
The security receipts under SARFAESI Act
A' is tried for murder of 'B' intensely beating him with a club causing his death, which of the following facts are in issue?
In the landmark case State of Andhra Pradesh v. Rayavarapu Punnayya & Another (1976), the Supreme Court laid down comprehensive principles for disting...
Under the Hindu Succession Act, 1956, after the 2005 Amendment, a daughter of a coparcener shall:
Where the amount to be spent by a company for the Corporate Social Responsibility Policy _____________, the requirement for the constitution of the Corp...