Output-Based Java Questions

This Java quiz is a set of classic "what is the output?" questions from interviews and written tests. Each one hides a rule about operators, overloading, initialization order or number types that you need to know cold.

मीडियम 10 सवाल ~6 मिनट पास होने के लिए 80% Java 17

मोड चुनें

आप गेस्ट के तौर पर खेल रहे हैं: XP और streak सेव रखने के लिए साइन इन करें।

सैंपल सवाल

सवाल 1 / 10

What does this print?

public class Main {
    public static void main(String[] args) {
        System.out.println('a' + 1 + "b" + 'a' + 1);
    }
}
जवाब दिखाएं

B. 98ba1 + is evaluated left to right. 'a' + 1 is char + int, so it is numeric addition: 97 + 1 = 98. Once a String appears, everything after it is concatenated as text.

इस क्विज़ में क्या है

  • char arithmetic and string concatenation order
  • Pre- and post-increment in one expression
  • Overload resolution with null
  • Static blocks, instance blocks and constructors
  • Rounding, overflow, Infinity and NaN

अक्सर पूछे जाने वाले सवाल

क्या अकाउंट ज़रूरी है?

नहीं। कोई भी खेल सकता है। XP, streak, badge और हिस्ट्री सेव रखने के लिए साइन इन करें।

क्या मैं इसे दोबारा दे सकता हूं?

हां। आपका बेस्ट स्कोर सेव रहता है, और हर बार सवाल और जवाब शफ़ल होते हैं।