- 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 constants names in Java?
While writing the name of the constants it is suggested to
- write all the letters in upper case.
- If constant contains more than one word they should be separated by underscore (_).
Example
public class ConstantsTest { public static final int MIN_VALUE = 22; public static final int MAX_VALUE = 222; public static void main(String args[]) { System.out.println("Value of the constant MIN_VALUE: "+MIN_VALUE); System.out.println("Value of the constant MAX_VALUE: "+MAX_VALUE); } }
Output
Value of the constant MIN_VALUE: 22 Value of the constant MAX_VALUE: 222
- Related Articles
- How do I write class names in Java?
- How do I write method 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 define string constants in C++?
- How do I search for names starting with A in MySQL?
- How to implement constants in java?
- How do I create dynamic variable names inside a JavaScript loop?
- How do I compare strings in Java?
- How do I read (or write) binary data in Python?
- How do I empty a list in Java?
- How do I search a list in Java?
- How do I write not greater than in a MySQL query?

Advertisements