forked from Anjalijha12345/Java-Problem-Solution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault value.java
34 lines (34 loc) · 875 Bytes
/
default value.java
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
27
28
29
30
31
32
33
34
// Java Program to demonstrate use of default values
import java.io.*;
class GFG {
// static values
static byte b;
static int i;
static long l;
static short s;
static boolean bool;
static char c;
static String str;
static Object object;
static float f;
static double d;
static int[] Arr;
public static void main(String[] args)
{
// byte value
System.out.println("byte value" + b);
// short value
System.out.println("short value" + s);
// int value
System.out.println("int value" + i);
// long value
System.out.println("long value" + l);
System.out.println("boolean value" + bool);
System.out.println("char value" + c);
System.out.println("float value" + f);
System.out.println("double value" + d);
System.out.println("string value" + str);
System.out.println("object value" + object);
System.out.println("Array value" + Arr);
}
}