Java Intermediate

0% completed

Previous
Next
Quiz
Question 1
What is Object-Oriented Programming (OOP) in Java?
A
A programming paradigm based on functions and procedures.
B
A programming paradigm based on objects that encapsulate data and behavior.
C
A programming paradigm based on global variables and shared functions.
D
A programming paradigm that prohibits inheritance.
Question 2
Which of the following is NOT a pillar of Object-Oriented Programming?
A
Encapsulation
B
Inheritance
C
Abstraction
D
Recursion
Question 3
Examine the following code snippet:
class Calculator {
    public int add(int a, int b) {
        return a + b;
    }
}
public class Test {
    public static void main(String[] args) {
        Calculator calc = new Calculator();
        System.out.println(calc.add(5, 7));
    }
}
What will be the output?
A
57
B
5
C
7
D
12

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next