Professional Documents
Culture Documents
Practical No. 07 & 08
Practical No. 07 & 08
07 & 08
Program Code:
Develop a program to show the use of implicit typecasting.
class ImplicitTypecasting{
byte p = 12;
short q = p;
int r = q;
long s = r;
float t = s;
double u =t;
}}
Exercise:
1. Write Error/Output of code:
class Test1{
int i = 100;
long l = i;
float f = l;
}}
class Test2{
char ch = 'c';
ch = num;
}}
int i = 100;
long l = i;
float f = l;
}}