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

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. 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.

Explore the full course: Up Lt Grade Assistant Teacher 2025