Print Literal Values
This program prints literal values directly.
Problem Statement
Write a Java program that prints integer, double, and string literals.
Source Code
| 1 | public class PrintLiterals { |
| 2 | public static void main(String[] args) { |
| 3 | System.out.println(100); |
| 4 | System.out.println(3.14); |
| 5 | System.out.println("Eduinq Literal"); |
| 6 | } |
| 7 | } |
Program Output
100 3.14 Eduinq Literal
Explanation
The program prints an integer literal, a double literal, and a string literal directly without storing them in variables, demonstrating printing of literals without variables.