Print Final Integer Constant
This program prints the value of a final integer constant.
Problem Statement
Write a Java program that declares a final integer constant and prints its value.
Source Code
| 1 | public class FinalInteger { |
| 2 | public static void main(String[] args) { |
| 3 | final int MAX_USERS = 100; |
| 4 | System.out.println("Maximum users allowed: " + MAX_USERS + " - Eduinq"); |
| 5 | } |
| 6 | } |
Program Output
Maximum users allowed: 100 - Eduinq
Explanation
final int MAX_USERS = 100; Declares a constant integer. Prints the constant with Eduinq branding. Conclusion: Shows how to declare and print integer constants using final.