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
Q

polymorphism has two forms

A

overloading and overriding

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

overloading is

A

same method name with different parameters

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

overriding is

A

same name, same parameter , same return type but different body

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

branching forms

A

if-else and switch

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

loops comes in

A

for , while, do-while, foreach

30
Q

loop control are

A

break

continue

31
Q

for each is used to

A

traverse an array or a collection in java

32
Q

True or false : for each loop has no loop variable

A

true

33
Q

True or false: break and continue statement is limited to 1 per loop

A

true

34
Q

T or F: arrays has a fixed size

A

true

35
Q

if an array position is not initialized it is ….

A

NULL

36
Q

an object is an … of a specific class

A

instance

37
Q

t or f: objects reserves a place in memory

A

true

38
Q

new is a keyword that

A

instantiate the object

39
Q

if an object is not instantiated it is

A

null

40
Q

to access fields we used … operator

A

dot operator

41
Q

each class must have ….

A

at least one constructor

42
Q

t or f: a constructor has a return value

A

false

43
Q

constructor name must be …

A

the same as the class name

44
Q

if no constructor is defined the complier creates one with no parameter called …

A

default constructor

45
Q

default constructor intialize the values with … for numeric … for booleans …. for object references

A

zero, false, null

46
Q

to call the parent class constructor we use

A

super();

47
Q

UML is

A

unified modeling language object oriented modeling language

48
Q

uml is represented by a ….. usually divided into three sections which are ….

A
  • class name
  • attributes (fields)
  • operations (methods)
49
Q

in uml + , - , # denotes ?

A

public , private, protected

50
Q

relationship types in uml

A

are inheritance , and association

51
Q

inheritance represents ….

A

a hierarchy between classes

52
Q

association represents …

A

a relationships between objects

53
Q

a package is a container …

A

for all related classes

54
Q

access modifier none (Package local) is visible in ….

A

only within the same package

55
Q

private is only accessible within …

A

the same class

56
Q

protected can be accessed within…

A

the same package and subclass

57
Q

public can be accessed …

A

anywhere

58
Q

static modifier is

A

for the entire class and not for a specific object

59
Q

final means its value

A

cant be changed

60
Q

private is visible in the same package class?

A

no

61
Q

private is visible inside the class

A

yes

62
Q

private is visible inside the same package sub class?

A

no

63
Q

protected is visible inside other package class?

A

no

64
Q

protected is visible inside same package class?

A

yes

65
Q

package local can be accessed from other package class

A

no

66
Q

package local can be accessed from other package sub-class

A

no

67
Q

protected modifier is visible in other package class

A

no

68
Q

static modifier can be accessed via …

A

class name

69
Q

non-static can only be accessed via …

A

object name

70
Q

final must be initialized when …. or in …

A

declared, constructor