Math, asked by mcjuniadiqbal, 5 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 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;

Answered by nehashanbhag0729
0

Answer:

hey watch the above pic for ur answer of the question .

hope it halps u

Attachments:
Similar questions