Concepts Flashcards

1
Q

Bytecode

A

An intermediate code between the source code and machine code.

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

JVM

A

Java Virtual Machine. It interprets the bytecode into machine code. It is part of the JRE.

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

JDK

A

Java Development Kit. It includes JRE, a Java compiler, a debugger, and more;

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

JRE

A

Java Runtime Environment; Executes Java programs; It includes JVM and Java libraries.

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

Declaring a variable

A

what kind of data it will store

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

What is a Java class?

A

a template (blueprint) that is used to create objects. It consists of data members and methods.

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

Object

A

objects have states and behaviors.

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

Eclipse

A

a Java IDE (Integrated Development Environment). It includes text editor, compiler or interpreter, and debugger, like IntelliJ IDEA

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

IDE

A

Integrated Development Environment. for example, visual studio.

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

How to create a Java object?

A

Declaration; Instantiation; Initialization

ClassName object = new ClassName()

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

What are Java constructors?

A
  • A special method that is used to initialize objects
  • You would call a constructor when an object is created. It can be used to set initial values for object attributes.
  • Note that the constructor name must match the class name and it can’t have a return type (like void)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Pascal case

A

a naming convention in which the first letter of each word in a compound word is capitalized.

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

SDK

A

software development kit

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

Java variable

A

a location in memory (storage area) to hold data. Each variable should be given a unique name (identifier)

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

statically-typed language

A

It means that all variables must be declared before they can be used.

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

Java expressions

A

a construct made up of variables, operators, literals, and method calls.

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

Java operators

A
  • arithmetic
  • assignment
  • comparison
  • logical
18
Q

truth table

A

a mathematical table used to determine if a compound statement is true or false.

component statement

19
Q

public in Java

A

an access modifier

  • the class is accessible by any other class
  • the code is accessible for all classes
20
Q

default in Java

A

an access modifier

  • the class is only accessible by classes in the same package.
  • the code is only accessible in the same package.
21
Q

private in Java

A

an access modifier

- the code is only accessible within the declared class.

22
Q

final in Java

A

if you don’t want the ability to override existing attributes values, declare attributes as final

23
Q

static methods/attributes in Java

A

can be accessed without creating an object of the class first

24
Q

Java statement

A

a complete unit of execution

25
Q

Refactor Code

A

changing the structure of a program without changing what it does

26
Q

Side Effect

A

anything a method does besides computing and returning a value

  • any change of instance or class field values
  • drawing something on the screen
  • writing to a file
  • a network connection
27
Q

Call Site (Method Invocation)

A

the point of code when the method is called

28
Q

Operator Precedence

A

rules that define the order that expressions are evaluated

29
Q

indexOf() Method

A

if indexOf doesn’t find the string we’re searching for, it returns -1

30
Q

string.charAt() Method

A
31
Q

Method Overloading

A

allows you to have multiple methods using the same method name

32
Q

Value Type

A
  • store values

- value types are copied by value

33
Q

Reference Type

A
  • store reference

- reference types are copied by reference. We have two references pointing to the same object in the memory.

34
Q

String Literal Pool

A

a storage area in Java heap where string literals stored.

35
Q

Literal

A

Any constant value which can be assigned to the variable

36
Q

string1 == string2 vs. string1.equals(string2)

A

== will test that the variables are referring to the same object, not that they refer to the objects with the same value
== checks the reference equality not the contents
.equals method checks for value equality

37
Q

StringBuilder Class

A

allows modifying the strings without creating new string objects

38
Q

Garbage Collection

A

to free heap memory by destroying unreachable objects.

39
Q

Stack vs Heap

A

The major difference between Stack memory and heap memory is that the stack is used to store the order of method execution and local variables while the heap memory stores the objects and it uses dynamic memory allocation and deallocation.

40
Q

Mutable Reference Type

A

a reference to an object that can be changed

41
Q

return a reference vs. return an object

A

method chaining for the method that returns an object

42
Q

single quotes vs. double quotes

A

Use single quotes for literal chars and double quotes for literal Strings