Integer Constants represent whole number values like 2, -16, 18246, 24041973, etc.įloating Constants represent fractional numbers like 3.14159, -14.08, 42.0, 675.238, etc. (a) Integer and floating constant Integer Constant (b) Assign the value of (1.732) to a variable with the requisite data type. (a) Assign the value of pie (3.142) to a variable with the requisite data type. The process of converting one predefined type into another is called type casting. It should not be a keyword or a boolean or null literal.Name of the variable should be a sequence of alphabets, digits, underscore and dollar sign characters only.What are the rules to assign a variable in a Java programming? The different types of tokens in Java are: What do you understand by Token? Name different types of tokens.Ī token is the smallest element of a program that is meaningful to the compiler. Its value can't be changed in the program. The keyword final before a variable declaration makes it a constant. What do you mean by constant? Explain with an example. This name of the variable is used in the program to refer to the stored value. Question 2Ī variable represents a memory location through a symbolic name which holds a known or unknown value of a particular data type. Write short answers Question 1ĭata types are used to identify the type of data a memory location can hold and the associated operations of handling it. Question 10Ī Java expression that contains all the elements of same data type is pure expression. Integer type value occupies 4 bytes in the memory. Question 8Īn element of Java program that is used to identify a class, function or value is called as identifier. The comma, exclamation, question mark etc., are termed as Tokens in Java language. Question 6Īssignment operator is used to store a value in the variable. In Java, the constants are also called literals. Question 4Įach individual component of a Java statement is known as token. Question 3ĪSCII code is decimal number to represent a character. Question 2Ī standard encoding system way of representing characters is Unicode. The character sets of Java is like alphabets of English language. Which of the following is a correct representation? Which of the following type is an exact representation of fractional values?īoolean Data is used to test a particular condition i.e. Which of the following is non-primitive data? Which of the following results in integer type? ![]() The ASCII codes of upper case alphabets range from: Chapter 3 Values and Data Types Class 9 - APC Understanding Computer Applications with BlueJĪ constant which gives the exact representation of data is calledĪ word used in a high level language which has a special meaning attached to it is called
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |