KnowledgeBoat Logo

Computer Applications

Define the following:

(a) Variable

(b) Floating literal

(c) String literal

(d) Character literal

Values & Data Types Java

16 Likes

Answer

(a) Variable — A variable is a named memory location which stores a value. The value of a variable can change depending upon the circumstances and problems in a program.
For example, add, emp_name, etc.

(b) Floating literal — Floating literal or Real literal are the fractional numbers. They are also called floating-point constants because the placement of decimal point can be after any digit of the numbers. For example, 24.6, -42.514, 0.0072, etc.

(c) String literal — A string is a set of alphanumeric characters. It may be a word, a sentence or a paragraph enclosed in double quotes (" ").
For example, "Understanding Computer Studies", "Year 2021", "10% per annum", etc.

(d) Character literal — All letters in uppercase or lowercase, digits and special symbols can be termed as character literals. A character literal represents a single character enclosed in single quotes (' ').
For example, 'I', 'd', '3', '*', etc.

Answered By

11 Likes


Related Questions