Please explain each step of this program.
Do not spam and the best answer will be selected as the brainliest.
Answer only if you have learnt Java programming basics.
Attachments:
DrStudy:
Plz answer fast
Answers
Answered by
1
Explanation:
- A class CharDemo is initialized with a main method
- in main method a character variable "ch1" is initialized
- in the next step "X" is assigned to to character variable "ch1"
- in the first print statement the output will be "X" since it id not behaving like integer
- in the next line of code the character value is post incremented
- so then the character's ASCII code will be increased by 1
- since the ASCII code of character "X" is 88, then 88 will be incremented to 89 and it will be turned into character which is "Y"
- then "Y" will be printed out
---Hope my answer will help you if have any other doubt's about programming and and other programming language related fell free to ask me, i will be help-full to you ( mark brainliest if you like my answer :) )
Similar questions