- Constants
- Constant is a fixed value.
- There are 3 types of constants.
- i)character
- ii)Numeric
- iii)Boolean
- character constants
- -------------------
- character constants are
- i)words.
- ii)alphabets[a-z,A-Z].
- iii)digits[0-9].
- iv)special symbols.
- character constants are of 2 types.
- i)single character constants
- ii)String constants.
- i)single chracter constant
- --------------------------
- single character enclosed in single quotes is known as
- single character constant.
- ex:
- 'a'
- 'x'
- '5'
- '*'
- ''
- '10'(ic)
- 'abc'(ic)
- String constants
- ----------------
- group of letters enclosed in double quotes is known as
- string constant.
- ex:
- "satya"
- "satya123"
- ""
- " "
- "a"
- "12345"
- Numeric constants
- -----------------
- All numbers are numeric constants
- They are 2 types
- Integer constant
- decimal/real/floating-point constant.
- Integer constant
- ----------------
- Number without fractional part is called integer constant.
- ex:
- 10
- 20
- 56
- decimal constant.
- -----------------
- Number with fractional part is called decimal constant.
- ex:10.7
- 5.6
For all those who have been searching for a simple and quick reference to learn programming languages and latest technologies in the most easiest format which covers whole of the syllabus.
Friday, November 18, 2016
Core Java[Session5]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment