Over 10 years we helping companies reach their financial and branding goals. Onum is a values-driven SEO agency dedicated.

CONTACTS
ECET 2026 Preparation

Day 25 – Night Session: Java – Functions/Methods in Java – ECET 2026 CSE

Java is one of the most important subjects in ECET CSE. Questions on Functions/Methods are very common because they test basic coding knowledge. By understanding the concept of methods in Java, you can easily answer direct and indirect questions in the exam.


📘 Concept Notes – Functions/Methods in Java

In Java, a method (also called a function) is a block of code that performs a specific task.

  • Methods help in code reusability and modularity.
  • They can accept input (parameters) and return a value.

Types of Methods in Java:

  1. Predefined Methods → Already defined in Java libraries (e.g., length(), sqrt()).
  2. User-defined Methods → Created by the programmer.

General Syntax of a Method in Java:

returnType methodName(parameters) {
   // method body
   return value; 
}

Example:

int add(int a, int b) {
   return a + b;
}
  • int → return type
  • add → method name
  • (int a, int b) → parameters
  • return a + b; → return statement

Method Categories:

  • Void methods: Do not return any value.
  • Return type methods: Return a specific type of value.
  • Parameterised methods: Accept parameters.
  • Non-parameterised methods: Do not take parameters.

⚙️ Important Points to Remember

  • Methods improve readability and reusability.
  • Every Java program must have a main() method.
  • Method overloading allows multiple methods with the same name but different parameters.

🔟 10 Most Expected MCQs – ECET 2026 [Java Methods]

Q1. In Java, a function is called?
A) Procedure
B) Method
C) Class
D) Object

Q2. Which of the following is the entry point of every Java program?
A) start()
B) main()
C) run()
D) execute()

Q3. A method that does not return any value should have return type:
A) null
B) void
C) empty
D) None

Q4. Which keyword is used to return a value from a method?
A) break
B) continue
C) return
D) exit

Q5. The method name and parameter list together are called?
A) Signature
B) Prototype
C) Header
D) Identifier

Q6. Method overloading means:
A) Two methods with same name but different parameters
B) Two methods with different names
C) Two methods inside different classes
D) None

Q7. What is the return type of the main() method in Java?
A) int
B) void
C) String
D) char

Q8. Which of the following is a predefined method?
A) add()
B) sqrt()
C) calculate()
D) sum()

Q9. The method which does not take any arguments is called?
A) Default method
B) Parameterised method
C) Non-parameterised method
D) Overloaded method

Q10. Methods in Java help in:
A) Modularity
B) Code reusability
C) Both A & B
D) None


Answer Key

Q.NoAnswer
Q1B
Q2B
Q3B
Q4C
Q5A
Q6A
Q7B
Q8B
Q9C
Q10C

🧠 Explanations

  • Q1 → B: In Java, functions are called methods.
  • Q2 → B: Every Java program starts execution from the main() method.
  • Q3 → B: Methods without return values must have return type void.
  • Q4 → C: The return keyword is used to return a value.
  • Q5 → A: Method signature = method name + parameter list.
  • Q6 → A: Overloading allows same method name with different parameter lists.
  • Q7 → B: The main() method always has void return type.
  • Q8 → B: sqrt() is a predefined method in Java’s Math class.
  • Q9 → C: Non-parameterised methods do not take arguments.
  • Q10 → C: Methods improve both modularity and reusability.

🎯 Why This Practice Matters for ECET 2026
Java is guaranteed to appear in ECET CSE exams. Questions on methods/functions are direct and easy to score. By practicing, students can secure 2–3 marks quickly. These concepts are also important for coding interviews and real-world programming.


📲 Join Our ECET Prep Community on Telegram
👉 For daily MCQs, explanations, and video sessions, join: @LearnNewThingsHub

Leave a comment

Your email address will not be published. Required fields are marked *