JAVA Introduction Flashcards

Lecture 1 oop

1
Q

JVM Stands for

A

Java virtual machine

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

JRE Stands for

A

Java runtime environment

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

JDK Stands for

A

java development kit

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

JVM only understands ….

A

bytecode

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

java files are compiled into ….

A

bytecode

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

JRE provides the ….,….., and other components to run the applets

A

libraries and java virtual machine

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

true or false: JRE contains tools and utilities such as compilers and debugging applets and applications.

A

false

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

JDK contains …..

A

everything in jre plus tools and compilers and debuggers necessary for developing applets and applications

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

Properties of Java ? (7)

A
  • Object oriented
  • Interpreted
  • portable
  • secure and robust
  • multi threaded
  • garbage collector
  • no support for multiple inheritance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

java file is compiled to …

A

class file (bytecode)

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

memory in java is allocated (dynamically- manually - statically )

A

dynamically

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

deallocation is process of

A

removing the objects that are no longer referenced from memory

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

garbage collector helps prevent ….

A

memory leaks

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

object oriented programming is a ….

A

programming paradigm based on the concept of objects

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

each object contains data in form of ….

A

fields , methods

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

object constitutes the

A

building blocks of the program

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

true or false : classes can’t form a hierarchy

A

false , they can

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

Principles of object oriented programming

A

Encapsulation
abstraction
inheritance
polymorphism

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

encapsulation is

A

process of combining data and methods into a single unit called a class

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

encapsulation helps in

A

keep data both safe from outside interference

allows to expose only necessary data

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

encapsulation can be controlled via

A

access modifiers private public and protected

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

abstraction is

A

to hide complexity of the program by hiding the unnecessary detail from the user can be achieved by using classes

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

inheritance allows

A

creating hierarchy of related classes

allows code reusability

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

Polymorphism is

A

same concept can have different meaning in different contexts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
polymorphism has two forms
overloading and overriding
26
overloading is
same method name with different parameters
27
overriding is
same name, same parameter , same return type but different body
28
branching forms
if-else and switch
29
loops comes in
for , while, do-while, foreach
30
loop control are
break | continue
31
for each is used to
traverse an array or a collection in java
32
True or false : for each loop has no loop variable
true
33
True or false: break and continue statement is limited to 1 per loop
true
34
T or F: arrays has a fixed size
true
35
if an array position is not initialized it is ....
NULL
36
an object is an ... of a specific class
instance
37
t or f: objects reserves a place in memory
true
38
new is a keyword that
instantiate the object
39
if an object is not instantiated it is
null
40
to access fields we used ... operator
dot operator
41
each class must have ....
at least one constructor
42
t or f: a constructor has a return value
false
43
constructor name must be ...
the same as the class name
44
if no constructor is defined the complier creates one with no parameter called ...
default constructor
45
default constructor intialize the values with ... for numeric ... for booleans .... for object references
zero, false, null
46
to call the parent class constructor we use
super();
47
UML is
unified modeling language object oriented modeling language
48
uml is represented by a ..... usually divided into three sections which are ....
- class name - attributes (fields) - operations (methods)
49
in uml + , - , # denotes ?
public , private, protected
50
relationship types in uml
are inheritance , and association
51
inheritance represents ....
a hierarchy between classes
52
association represents ...
a relationships between objects
53
a package is a container ...
for all related classes
54
access modifier none (Package local) is visible in ....
only within the same package
55
private is only accessible within ...
the same class
56
protected can be accessed within...
the same package and subclass
57
public can be accessed ...
anywhere
58
static modifier is
for the entire class and not for a specific object
59
final means its value
cant be changed
60
private is visible in the same package class?
no
61
private is visible inside the class
yes
62
private is visible inside the same package sub class?
no
63
protected is visible inside other package class?
no
64
protected is visible inside same package class?
yes
65
package local can be accessed from other package class
no
66
package local can be accessed from other package sub-class
no
67
protected modifier is visible in other package class
no
68
static modifier can be accessed via ...
class name
69
non-static can only be accessed via ...
object name
70
final must be initialized when .... or in ...
declared, constructor