- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do I write method names in Java?
While writing a method name we should follow the camel case i.e. first letter of the first word should be small and the first letters of the remaining (later) words should be capital.
Example
public class Test { public void sampleMethod() { System.out.println("This is sample method"); } public void demoMethod() { System.out.println("This is demo method"); } public static void main(String args[]) { Test obj = new Test(); obj.sample(); obj.demo(); } }
Output
This is sample method This is demo method
- Related Articles
- How do I write class names in Java?
- How do I write variable names in Java?
- How do I write constructor names in Java?
- How do I write interface names in Java?
- How do I write package names in Java?
- How do I write constants names in Java?
- How do I time a method execution in Java
- How do I search for names starting with A in MySQL?
- How do you write a method in Java that can print object in array?
- How do I create dynamic variable names inside a JavaScript loop?
- How do I invoke a Java method when given the method name as a string?
- How do I use method overloading in Python?
- How do I cache method calls in Python?
- How do I compare strings in Java?
- How do I read (or write) binary data in Python?

Advertisements