Question
What will the following Java code snippet output when executed, which uses a simple constructor and method overloading ? class Calculator { int add ( int a, int
What will the following Java code snippet output when executed, which uses a simple constructor and method overloading ? class Calculator { int add ( int a, int
b) { return a + b; } double add ( double a, double
b) { return a + b; } public static void main (String[] args) { Calculator calc = new Calculator (); System.out.println(calc.add( 5 , 10 )); // Line 1 System.out.println(calc.add( 5.5 , 10.5 )); // Line 2 }}
More Basics of Computers Questions
- Which CPU scheduling algorithm allocates CPU to the process with the shortest burst time first?
- In deep learning, which type of neural network is most suitable for sequential data like time series?
- What is the main advantage of using incremental backups over full backups?
- Which HTTP method is used to send data to the server and process it without affecting the state of the resource?
- In Black Box Testing, which of the following is the primary focus?
- What does RAM stand for and what is its primary characteristic?
- In data communication networks, which protocol is responsible for ensuring reliable data transfer between devices over a network?
- In Object-Oriented Programming, which of the following correctly demonstrates the concept of Aggregation?
- Which of the following is an example of Polymorphism in Object-Oriented Programming?
- What does 'IMPS' stand for?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
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)