MidTerm Flashcards

(35 cards)

1
Q

Variable represented in

A

Unicode

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

Variable Name

A

must start with a character, and can include any unicode character

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

Two datatypes of Java

A

Primitive and Non-primitive

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

Primitive examples

A

byte, short, long, int, float, double, boolean and char

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

Non-primitive examples

A

String, Array, Classes

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

byte size

A

1 byte; -2^7 to 2^7 where 7 = 8 - 1

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

short size

A

2 byte; -2^15 to 2^15 where 15 = 2x8-1

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

int size

A

4 byte; -2^31 to 2^31 where 31 = 4x8-1

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

long size

A

8 byte; -2^(8x8-1) to 2^(8x8-1)

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

char size

A

2 byte

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

float

A

4 byte; 6 to 7 decimals

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

double

A

8 byte; 15 decimals

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

in Java, non-primitives are known as

A

reference types

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

Shortcut If then else

A

exp ? true : false

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

Strongly typed is

A

strict rule with data type conversion

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

Statically typed

A

safe and secure; it cannot ever be bound to an object of a different type

17
Q

Dynamically typed

A

unpredictable behavior; can be assigned to objects of different type

18
Q

Strings are

19
Q

If you wish to have a string you can change the value of you should use

20
Q

If i want to concat a string together how?

A

s=s.concat(“ appended”);

21
Q

A ______ is a non-primitive data type in Java, while an _______ is an instance of a class

22
Q

Why a class is the blueprint or template for an object ?

A

the complete syntax for handling encapsulation, abstraction, polymorphism, and inheritance

23
Q

before compilation file extension for class

24
Q

after compilation file extension for class

25
during execution .class file is run
in the JVM
26
syntax for methods that return a value
public returnType methodName(parameters){ | }
27
accessing attributes outside the class definition
. | myBestFriend._name = "Lara";
28
Formal parameters
are declared in the method heading
29
+ UML Class Diagram
public
30
- UML Class Diagram
private
31
Instance Variables
class variables basically
32
what does a class variable hold?
a memory address
33
what does a primitive variable hold?
a value
34
Aliases
multiple class variables that have the same memory address. They point to the same object.
35
Do not use _______ operator with two class variables
==. Use someClass.equals(otherClass);