Computer Science · Java Programming
निम्नलिखित जावा कोड को संकलित (compile) और निष्पादित (execute) करने का प्रयास करने पर क्या परिणाम होगा? public class Main { public static void main(String args[]) { int a = 21; b = 2; int num = a / b; System.out.println(num); } }
- 1विभाजन के कारण एक रनटाइम अंकगणितीय अपवाद (runtime arithmetic exception) उत्पन्न होता है
- 2एक संकलन त्रुटि (compilation error) आती है क्योंकि वेरिएबल 'b' को डेटा टाइप के साथ घोषित नहीं किया गया है✓
- 3कोड चलता है और आउटपुट देता है: 10.5
- 4कोड चलता है और आउटपुट देता है: 10
सही उत्तर देखें
एक संकलन त्रुटि (compilation error) आती है क्योंकि वेरिएबल 'b' को डेटा टाइप के साथ घोषित नहीं किया गया है
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Java Programming?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Java Programming