Computer Science, asked by mcjuniadiqbal, 7 months ago

Given: char ch = „D‟;

Write a Java statement that will replace the current value of the variable ch by a character which is 5

steps ahead of it. (The statement should implement type casting.)​

Answers

Answered by Ajinkyaa
0

Explanation:

first we would write program 1 an then {this bracket

Answered by anindyaadhikari13
1

\star\:\:\:\sf\large\underline\blue{Question:-}

Given: char ch = “D”

Write a Java statement that will replace the current value of the variable ch by a character which is 5 steps ahead of it. (The statement should implement type casting.)

\star\:\:\:\sf\large\underline\blue{Answer:-}

The java statement can be written in two ways.

Method 1.

char ch='D';

int a=(int)ch;

a+=5;

ch=(char)a;

Method 2.

char ch='D';

ch+=5;

Similar questions