-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathj4Literals.java
More file actions
26 lines (20 loc) · 792 Bytes
/
j4Literals.java
File metadata and controls
26 lines (20 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// literals
// package java;
public class j4Literals{
public static void main(String[] args){
System.out.println("\nLiterals in Java");
// Integer literal
byte age = 80;
short count = 12365;
long ln = 245613333l; // store big integer value we want to add l in last
// String literal
char ch = 'V'; //char declare insingle quotes
String name = "Ved Prakash Gupta";
// floating poin literal
float f1 = 5.6f; // we can declare float by adding f in last that say this is float literal
double doub = 2.336D; // As per you choice by defalut set to Double or we add D in last
// Bool literal
boolean bo = true;
System.out.println(name);
}
}