Revising Basic Java Concepts Flashcards
D: Procedural Programming Paradigm
Programming approach that focuses on the procedures for solving problems.
D: Object
An object is an entity having specific characteristics,identity, and behaviour.
Also, instance of a class
D: Class
A class is a blueprint representing objects having similar characteristics and behaviour
D: Data Abstraction
Data Abstraction refers to the act of representing only the essential features without showing the background details or explanations.
Example: Switchboard
D: Modularity
Modularity is the act of partitioning a program into individual components.
D: Encapsulation
Encapsulation is the wrapping up of data and functions into a single unit called class.
Encapsulation is a way of implementing Abstraction.
D: Inheritance
Inheritance is the ability of one class of things to inherit properties or capabilities from another class. Example: class 'car' has inherits some of its properties from the class 'automobiles'.
D: sub class or derived class
A class that inherits properties or capabilities from another class.
D: base class or super class
A class from which another class inherits properties.
D: Polymorphism
Polymorphism is the property by which a message can be sent to objects of different classes and each object can respond differently based on its class.
How does java solve the problem of platform independence?
By using Bytecode
Java bytecode is interpreted by a special java interpreter called …
Java Virtual Machine
What are the most common java programs?
Applications and Applets
What are Applications?
Applications are standalone programs that run independently of other programs or applications.
What are Applets?
Applets are programs that run inside another application such as a web browser.
What is initial class?
Initial class is the class in a java program that must have the same name as the java program file and it contains the main() method. If there is one class in a java program it is the initial class
Java uses the _________ character set.
Unicode. It is a two byte character set
What are keywords?
Keywords are words which have special meaning in java. They are reserved for special purposes and must not be used for normal identifier names.
Example: final,int,etc.
What are tokens?
TOKENS ARE THE SMALLEST INDIVIDUAL UNITS IN A PROGRAM.
Keywords,identifiers,literals,operators and punctuators are tokens in a java program.
What are literals?
Literals (aka constants) are data items that have fixed values.
What are the types of literals java allows?
- Integer literals: whole numbers,can be written in decimal,octal or hexadecimal form
- Floating-point literals: numbers having fractional(decimal) point. Can be written in fractional (0.00039) or exponential (0.39E-5)
- Boolean literals: represented by true or false.
- Character literals:single character or escape sequence enclosed by single quotation marks.
- String literals: one or more characters enclosed in double quotation marks.
- The null literal: represents null reference and is written as null
What are identifiers?
Identifiers are names given to various program units by the programmer. They are the names of variables,classes,methods,etc.
What are the rules that must be followed while forming identifiers?
- Identifiers can have alphabets, digits, underscore and dollar sign,can be of any length.
- Must not begin with a digit.
- Must not be a keyword.
- Java is case sensitive.
What is a variable?
A variable is a named memory location which holds a data value of a particular data type.