Typecasting

  Typecasting

Typecasting:- typecasting help to convert one data type to another data type

//Typecasting
package com.company;

public class Main {

public static void main(String[] args) {
// write your code here
//int type variable
int a=33;
System.out.println("int variable : "+a);

//convert int into double
double c=a;
System.out.println("double variable is : "+c);

}
}
output:-
int variable : 33
double variable is : 33.0

Process finished with exit code 0

Comments

Popular posts from this blog

the distance between two cities (in km is input through the keyboard. write a program to convert and print this distance in meter ,feet inches and centimeter.

CREATE UNIT CONVERTER APP

write a program to check whether a triangle is valid or not, when the threeangles of the triangle are entered through the keyboard. A triangle is valid if the sumof all the three angles is equal to 180 degrees