Constants in java

931 views 11 slides Sep 23, 2020
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

I hope this presentation will helpful for students


Slide Content

CS8392 Object Oriented Programming CONSTANTS Presented by : Manojkumar Information Technology II-year

What is a Constants? Constants mean the fixed values that do not change during the execution of a program Example: =3.14

Numeric Constants Numeric Constants are used for representing the numerical values. The numeric values can be Integer Real type

Integer Constants Integers means sequence of digits . there are three types Decimal Integer: the decimal integers consist of a set of digits through 0 to 9 Octal Integer: The octal integer consist of a set of 0 to 7 Hexadecimal Integer: It consist of 0 to 9 and letters A to F

Real Constants Real constants contains the floating point parts Example: 0.045 0.006

Character constant A single character constant is enclosed within a pair of single quotes. Example: ‘a’ ‘T’

String constant A string is a collection of characters enclosed within double quotes The characters can be alphabets, numbers, white spaces or special characters. Example: “India” “Best”

Thank You