Computer Science, asked by DrStudy, 1 year ago

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
ashwin456ojha: Dude mark its as brainliest answer if this is correct

Answers

Answered by rakeshchennupati143
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 :) )


rakeshchennupati143: good*
DrStudy: ok
DrStudy: But...
DrStudy: I want your answer because I think that your answer is more reliable.
DrStudy: Plz answer that question too.
DrStudy: plz
rakeshchennupati143: ok but mark my answer as brainliest then ok?
DrStudy: I will if that helps so and I think it will.
rakeshchennupati143: ok i'm answering it will take 10min jus wait
DrStudy: well ok
Similar questions