Which of the following is/are correct about Java programming? I. All functions…
2021
Which of the following is/are correct about Java programming? I. All functions in Java must be members of some class II. Member functions are called methods in Java
- A.
Only I
- B.
Only II
- C.
Both I and II
- D.
Neither I nor II
Attempted by 182 students.
Show answer & explanation
Correct answer: C
In Java, all functions must belong to a class, making Statement I correct. Member functions are explicitly termed methods in Java syntax, confirming Statement II is also accurate. Therefore, both statements align with Java's object-oriented structure.