Chapter 1: Revision of Class IX
Class IX Chapters
Chpater 1: Revision of Class IX
Introduction to Object Oriented Programming Concept
Q1.What is the default value of float and int? [I.C.S.E. 2015]
Ans:-
Data Type Default Value (for fields) Occupies memory
int 0 4 bytes char \0 1 byte float 0.0f 4 bytes
long 0L 16 bytes
float 0.0f 8 bytes
double 0.0d bytes long 0l bytes short 0 bytes boolean false 1 byte byte 0 1 byte
Q2.Name two principles of OOP's? [I.C.S.E. 2015]
Ans:- 1. Inheritance 2. Polymorphism
Q3.What are identifier? [I.C.S.E. 2015]Ans:- 1. Inheritance 2. Polymorphism
Q4.Identifies the literals given below?
Ans:- 1. Inheritance 2. Polymorphism
Q5.What are Constants Ans:Constants is a fixed value which does not change during the execution of a program or constants is the name memory location whose contents can not be changed during the execution of the program. Example final int x=10;
Q6.What are Literal? Ans:Literals in Java are a synthetic representation of boolean, character, numeric, or string data. They are a means of expressing particular values within a program. They are constant values that directly appear in a program and can be assigned now to a variable.
Q7. Why java is called Platform Independent? Ans:-Java is considered platform-independent because it can be written once and run on multiple platforms without any code changes. This is possible because Java source code is compiled into a universal bytecode that can be executed on any device with a Java Virtual Machine (JVM).
Q8 What are Data Types? Ans:-Primary data types are also known as the fundamental data types because they are pre-defined or they already exist in the Java. All the other types of data types (derived and user-defined data types) are derived from these data types. Primary data types in Java are of 8 types: int, char, float, and double.
No comments:
Post a Comment