Which of these is the correct format to use to create the literal char value a?

A) 'a'
B) "a"
C) new Character(a)
D) 00a

Showing Answers 1 - 1 of 1 Answers

prajakta mamidwar

  • Mar 14th, 2006
 

Literals: Are the values to be stored in var & constants.

Integer Literals: numeric literals

Octal Notation :Numnber prefixed by zero

Ex :0123

Hexadecimal Notation: Number prefixed by 0x.

Ex: 0x123,0x45,

Decimal Notation: Ex: n=3,a=4;

Floating point Literals: Ex: n=1.2;

Character Literal: Ex: n='a';

String literal: Ex:n="hello"

Boolean literal: Ex: x=true,y=false

so valid char literal in given ex is A)'a' 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions