The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value? 1)char ch=65; 2)char cg='\65'; 3)char ch='\0041'; 4) char char='A'; 5) char ch="A"; The answer is 4. why 1 is not right? Thanks
Hi, Manfred, But isn't 'char'(in the option 4, variable name) a keyword in Java. So why it is used for naming variable without error? Have a good day! Andy
Hi, 4 is not correct(If it is not Typo) becoz at char char='A', compiler will object "Invalid Expression" or ; expected. Only 1 is the right answer. thanks
Hi, I have the book. Quan has mistyped the question. In the book all the answers start with: char ch = I was just telling Quan that the answers she was given was not totally correct. My book final exam has the question (written correctly) and the answers are 1 and 4. Sorry, Manfred.
Don't get me started about those stupid light bulbs.