Question

Consider the following Java code: public class LengthMix {     public static void main(String[] args) {         int[] numbers = {10, 20, 30, 40};         String message = "Java";         System.out.println(numbers.length + message.length());     } } What will be the output of this program?

A 4
B 8
C 10
D 12
E Compile-time error
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)