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 of the following protocols is used for resolving IP addresses to MAC addresses in a network?
- The time horizon of data warehouse is
- What is the space complexity of program to reverse stack recursively?
- In RESTful APIs, which HTTP method is typically used to completely replace an existing resource with new data?
- In Numerical and Statistical Computing, which method is used for solving linear equations with large datasets?
- Which of the following is a primary reason for using digital signatures in modern cryptography?
- Which of the following best describes the main advantage of a Management Information System (MIS)?
- Which of the following is not a valid difference between IPv4 and IPv6?
- Which of the following best describes the IaaS model?
- Which of the following is the primary purpose of access control in network security?
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)