Final Exam Flashcards

1
Q

Hard Drive

A

Stores data

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

RAM

A

Temporarily stores data

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

Which storage does the processor use?

A

RAM

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

What are programming languages listed high to low level?

A

Pseudo > high > assembly > machine

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

Name high level object oriented programming languages

A

C#, C++, Java

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

What is java assembly language?

A

Java bytecode for JVM

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

What is machine code?

A

Binary, executable

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

What does compiler do?

A

Converts code into executable form

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

What does interpretor do?

A

Translates while running program

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

How is java compiled?

A

By Javac to bytecode

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

What is bytecode?

A

A special portable executable for Java compiled by Javac

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

What are the phases of programming?

A

Define/analyze, design, write code, test code, document, maintain/upgrade

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

What are the three data types?

A

Primitive, collections, and objects

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

What is one byte?

A

8 bits

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

What are boolean, byte, char, short, and float?

A

Primitive variables

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

What must at least one class in a project have?

A

A main method

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

What is structured processing?

A

Inputing data, processing, and producing output

Sequence, decisions, loops

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

What is procedural processing?

A

Passing data, processing, and returning values

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

What is object oriented processing?

A

Defining data attributes and methods that operate on them, creating powerful new data types

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

What are the different types of identifiers?

A

Classes, methods, variable names

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

Identifiers can contain:

A

Letters, digits, and $

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

What are " , \ , \n , \t ?

A

Escape sequences

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

When is final used?

A

For constants whose values do not change

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

Postfix - int y = x++ results in:

A

Y is a number, then x is incremented

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

Prefix - int y = ++x results in:

A

x is incremented, then y is set to incremented number

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

What is Java API?

A

Set of pre-existing software; some of which needs to be imported

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

Are static methods instantiated or called?

A

Does not need to be instantiated, just called

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

If a static method is in a different class how do you call it?

A

With “Classname.methodName(params)”

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

How do you call a method that belongs to an object?

A

objectVariable.methodName(params)

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

Where does character index start?

A

0

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

Use _____ operator to combine strings

A

+

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

Scanner methods are:

A
next()
nextInt()
nextDouble()
next().charAt(0)
nextLine() (nextLine does not skip spaces, tabs and newlines to get next item)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

String1 == string2 compares what?

A

Reference variables and location in memory

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

What are some character methods?

A

isLetter()
isDigit()
toUpperCase()
toLowercase()

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

What are some object reference variables?

A

Arrays, API library, user-defined classes

36
Q

What is a reference variable?

A

Contain references to objects in memory where actual data is stored.

37
Q

What do objects do with primitives passed to them?

A

Make copies

38
Q

What is the switch format?

A
switch (variable) {
   case c1: statement;
   break;
   case c2: statement;
   break;
   }
39
Q

Benefit of switch format?

A

Can have multiple cases on one line

40
Q

Order of operations

A
()
- negation, ! not, casting, ++, --
*, /, %
\+, -, concat
, <=, >=
==, !=
&&
||
=, *=, %=, etc
41
Q

Two types of loop designs

A

Counter controlled - certain number of times
(for loop)

and

Sentinel controlled - until event/value occurs
(while and do/while loop)

42
Q

Checks condition after running once

A

For loop

43
Q

Checks condition before running

A

While loop

44
Q

Does the do statement, then checks condition, then returns to complete those conditions if while condition is met

A

Do/while loop

45
Q

What happens when “return” is encountered?

A

Method immediately ends

46
Q

Static methods

A

Can be called without being instantiated

47
Q

When passed to methods, primitives:

A

Are copied

48
Q

When passed to methods, objects:

A

Addresses are passed so they are directly acted on

49
Q

Scope

A

Where variables can be used

50
Q

Variables with the same name can be declared in separate blocks/methods UNLESS:

A

Nested

51
Q

Math.

A
pow(number to square, power)
sqrt(#)
cell(#)
floor(#)
round(#)
PI
E
52
Q

Lets you create an object of primitive type

A

Wrapper class

53
Q

What does stringBuffer do?

A

Lets you change characters
toString()
length(), etc

54
Q

When can you call a static method from another class?

A

When both classes are in the same package

55
Q

How to call for each loop

A

for (TypeOfData anyWordYouWant: nameOfArray) {
actions
}

56
Q

When arrays are created, primitives are set to ____, and reference objects are set to ____

A

0 and null

57
Q

4 types of access specifiers

A

Public - accessible by anything
Protected - same folder only
Private - only within the same class
Default - package private

58
Q

What do classes do?

A

Defining new data types

59
Q

How do you instantiate a class?

A

Create variables of the class type and calling a constructor

60
Q

What does a class contain?

A

Data and methods

61
Q

Which data type do classes contain?

A

Static and instance

62
Q

What is a static data type?

A

It does not need to be instantiated and only one copy is shared by all objects of the class

63
Q

Static methods do not use instance members to do its job. T or F?

A

True

64
Q

Static methods are called with ______

A

Class name

65
Q

What is instance data?

A

Each object has its own copies and values

66
Q

How are instance methods called?

A

With a class object and may operate directly on any data members

67
Q

How to override a static method

A

You cannot. The point of a static method is that it is the same method throughout all objects

68
Q

How can you compare object addresses?

A

==

69
Q

How can you compare objects?

A

.equals()

70
Q

Immutable

A

Cannot be changed after being created

Ex. Integer, Double, and String

71
Q

Object array syntax?

A

FirstClass rays[] = new FirstClass[10]

Rays[0] = new FirstClass(‘a’, 10)

72
Q

What is overloading?

A

Same method name with different parameters

73
Q

Inheritance

A

Creating a subclass by extending a superclass

74
Q

Overriding

A

Redefining a super method in the subclass

75
Q

Relationships

A

Uses - class uses method/data of another class

Has - class has instance of another class/method

Is - is a subclass of another class

76
Q

Super keyword

A

Calls super class

77
Q

How can subclasses directly access and use private members?

A

Use super.get or super.set methods

78
Q

You can extend from how many classes?

A

One

79
Q

What is shared with extended class?

A

All methods

80
Q

Upcasting

A

Cast subclass to superclass type

Shares methods and data of superclass

81
Q

Upcasting is implicit. Tor F?

A

True

82
Q

Downcasting is implicit. T or F?

A

False. Explicit

83
Q

Static methods can not access instance data. T or F?

A

True

84
Q

Instance methods can not access static data. T or F?

A

False. They can access static data

85
Q

Recursion

A

Method repeatedly calls itself

86
Q

Iteration

A

Method uses loops without repeatedly calling itself