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 phase of the Software Development Lifecycle (SDLC) focuses on identifying the feasibility and goals of the project?
- Which of the following is the primary difference between a public cloud and a private cloud?
- Recursion uses
- Dynamic programming is used by
- Which protocol is responsible for resolving IP addresses to MAC addresses in a local network?
- What is a common security control used to protect sensitive data during transmission over the internet?
- Which of the following is a primary reason for using digital signatures in modern cryptography?
- Bitwise operators in C++
- In the design and analysis of algorithms, which of the following algorithms is based on the greedy approach?
- Which of the following best describes the concept of abstraction in object-oriented programming (OOP)?
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)