Practical No 9: Explicit Type Casting

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Roll No: 51

Practical No 9
Explicit type casting:
public class pr9

public static void main(String[] args)

double num = 38.55;

System.out.println("double num is = "+num);

int data = (int) num;

System.out.println("int num is "+data);

Output:

double num is = 38.55

int num is = 38

You might also like