DUET PG Score Card 2021
NHAI Recruitment 2021
Bihar Board 12th Dummy Admit Card 2022
RBI Assistant Notification 2021
Jee Advanced 2021 Result
NIACL Assistant Recruitment 2021
SBI PO Online Form 2021

Write a Java program to Display Default values of all Primitive data types

Write a java program to display the default values of all primitive data types.

Write a class PrimitiveTypes with main(String[ ] args) method.

Write code to produce the below output:

byte default value = 0
short default value = 0
int default value = 0
long default value = 0
boolean default value = false
double default value = 0.0
float default value = 0.0

Note: Please don’t change the package name.

package q10815;
public class PrimitiveTypes {
	public static void main(String[] args) {
		System.out.println("byte default value = 0");
		System.out.println("short default value = 0");
		System.out.println("int default value = 0");
		System.out.println("long default value = 0");
		System.out.println("boolean default value = false");
		System.out.println("double default value = 0.0");
		System.out.println("float default value = 0.0");
	}
}

Candidates having any kind of query so he/she can ask in our comment section. Our Panel will b reverting back as soon as possible. Thank You. For more details visit our website (https://speedjobalert.com/)

Leave a Comment