Question: Given the following declaration: char c = A; What is the simplest way to convert the character value in c to an int? Select the

Given the following declaration: char c = ‘A’; What is the simplest way to convert the character value in c to an int? Select the one correct answer.

(a) int i = c;

(b) int i = (int) c;

(c) int i = Character.getNumericValue(c);

Step by Step Solution

3.37 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

A value of type char ca... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!