Revising Basic Java Concepts Flashcards

1
Q

D: Procedural Programming Paradigm

A

Programming approach that focuses on the procedures for solving problems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

D: Object

A

An object is an entity having specific characteristics,identity, and behaviour.
Also, instance of a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

D: Class

A

A class is a blueprint representing objects having similar characteristics and behaviour

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

D: Data Abstraction

A

Data Abstraction refers to the act of representing only the essential features without showing the background details or explanations.
Example: Switchboard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

D: Modularity

A

Modularity is the act of partitioning a program into individual components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

D: Encapsulation

A

Encapsulation is the wrapping up of data and functions into a single unit called class.
Encapsulation is a way of implementing Abstraction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

D: Inheritance

A
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'.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

D: sub class or derived class

A

A class that inherits properties or capabilities from another class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

D: base class or super class

A

A class from which another class inherits properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

D: Polymorphism

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does java solve the problem of platform independence?

A

By using Bytecode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Java bytecode is interpreted by a special java interpreter called …

A

Java Virtual Machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the most common java programs?

A

Applications and Applets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are Applications?

A

Applications are standalone programs that run independently of other programs or applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are Applets?

A

Applets are programs that run inside another application such as a web browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is initial class?

A
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
17
Q

Java uses the _________ character set.

A

Unicode. It is a two byte character set

18
Q

What are keywords?

A

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.

19
Q

What are tokens?

A

TOKENS ARE THE SMALLEST INDIVIDUAL UNITS IN A PROGRAM.

Keywords,identifiers,literals,operators and punctuators are tokens in a java program.

20
Q

What are literals?

A

Literals (aka constants) are data items that have fixed values.

21
Q

What are the types of literals java allows?

A
  1. Integer literals: whole numbers,can be written in decimal,octal or hexadecimal form
  2. Floating-point literals: numbers having fractional(decimal) point. Can be written in fractional (0.00039) or exponential (0.39E-5)
  3. Boolean literals: represented by true or false.
  4. Character literals:single character or escape sequence enclosed by single quotation marks.
  5. String literals: one or more characters enclosed in double quotation marks.
  6. The null literal: represents null reference and is written as null
22
Q

What are identifiers?

A

Identifiers are names given to various program units by the programmer. They are the names of variables,classes,methods,etc.

23
Q

What are the rules that must be followed while forming identifiers?

A
  1. Identifiers can have alphabets, digits, underscore and dollar sign,can be of any length.
  2. Must not begin with a digit.
  3. Must not be a keyword.
  4. Java is case sensitive.
24
Q

What is a variable?

A

A variable is a named memory location which holds a data value of a particular data type.

25
Q

What is a constant value?

A

A constant value represents a named value that remains fixed throughout the program. A constant is declared in a similar way as a variable but with the final keyword.

26
Q

What are data types?

A

Data types are means to identify the type of data and associated operations of handling it.

27
Q

What are the categories of data types provided by java?

A
  1. Primitive data types

2. Reference data types

28
Q

What are primitive data types?

A

Primitive data types are the data types that are provided by the language.
They are not based on any other data types.
They are also called FUNDAMENTAL or INTRINSIC DATATYPES

29
Q

What are reference datatypes?

A

They are datatypes that are created using primitive datatypes.
They are used to store memory address of an object.

30
Q

Name the primitive data types in java.

A
  1. Numeric Integral:positive and negative whole numbers. Int,short,byte,long.
  2. Floating point: can store fractional numbers.
    Float(precision of six digits) and double(precision of 15 digits).
    Java assumes fractional numbers as DOUBLE by default.
  3. Character : used to store characters.
  4. Boolean : represents a single true/false value.
31
Q

Name few reference data types in java.

A

Arrays,classes and interfaces.

32
Q

Reference is aka …….

A

Pointer or memory address in other languages

33
Q

What are the two values associated with a symbolic variable?

A
  1. rvalue(data value)

2. lvalue(location value)

34
Q

What are the types of operators offered by java?

A
  1. Arithmetic: +,-,*,/,%
  2. Increment/Decrement: ++,–
    Prefix-change then use
    Postfix-use then change
  3. Relational: aka comparison operators
    ,<=,>=,==,!=
  4. Logical: &&,||,!
    combine 2or more relational operations for decision making
  5. Shift operators