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
Prefix - int y = ++x results in:
x is incremented, then y is set to incremented number
26
What is Java API?
Set of pre-existing software; some of which needs to be imported
27
Are static methods instantiated or called?
Does not need to be instantiated, just called
28
If a static method is in a different class how do you call it?
With "Classname.methodName(params)"
29
How do you call a method that belongs to an object?
objectVariable.methodName(params)
30
Where does character index start?
0
31
Use _____ operator to combine strings
+
32
Scanner methods are:
``` next() nextInt() nextDouble() next().charAt(0) nextLine() (nextLine does not skip spaces, tabs and newlines to get next item) ```
33
String1 == string2 compares what?
Reference variables and location in memory
34
What are some character methods?
isLetter() isDigit() toUpperCase() toLowercase()
35
What are some object reference variables?
Arrays, API library, user-defined classes
36
What is a reference variable?
Contain references to objects in memory where actual data is stored.
37
What do objects do with primitives passed to them?
Make copies
38
What is the switch format?
``` switch (variable) { case c1: statement; break; case c2: statement; break; } ```
39
Benefit of switch format?
Can have multiple cases on one line
40
Order of operations
``` () - negation, ! not, casting, ++, -- *, /, % +, -, concat , <=, >= ==, != && || =, *=, %=, etc ```
41
Two types of loop designs
Counter controlled - certain number of times (for loop) and Sentinel controlled - until event/value occurs (while and do/while loop)
42
Checks condition after running once
For loop
43
Checks condition before running
While loop
44
Does the do statement, then checks condition, then returns to complete those conditions if while condition is met
Do/while loop
45
What happens when "return" is encountered?
Method immediately ends
46
Static methods
Can be called without being instantiated
47
When passed to methods, primitives:
Are copied
48
When passed to methods, objects:
Addresses are passed so they are directly acted on
49
Scope
Where variables can be used
50
Variables with the same name can be declared in separate blocks/methods UNLESS:
Nested
51
Math.
``` pow(number to square, power) sqrt(#) cell(#) floor(#) round(#) PI E ```
52
Lets you create an object of primitive type
Wrapper class
53
What does stringBuffer do?
Lets you change characters toString() length(), etc
54
When can you call a static method from another class?
When both classes are in the same package
55
How to call for each loop
for (TypeOfData anyWordYouWant: nameOfArray) { actions }
56
When arrays are created, primitives are set to ____, and reference objects are set to ____
0 and null
57
4 types of access specifiers
Public - accessible by anything Protected - same folder only Private - only within the same class Default - package private
58
What do classes do?
Defining new data types
59
How do you instantiate a class?
Create variables of the class type and calling a constructor
60
What does a class contain?
Data and methods
61
Which data type do classes contain?
Static and instance
62
What is a static data type?
It does not need to be instantiated and only one copy is shared by all objects of the class
63
Static methods do not use instance members to do its job. T or F?
True
64
Static methods are called with ______
Class name
65
What is instance data?
Each object has its own copies and values
66
How are instance methods called?
With a class object and may operate directly on any data members
67
How to override a static method
You cannot. The point of a static method is that it is the same method throughout all objects
68
How can you compare object addresses?
==
69
How can you compare objects?
.equals()
70
Immutable
Cannot be changed after being created | Ex. Integer, Double, and String
71
Object array syntax?
FirstClass rays[] = new FirstClass[10] Rays[0] = new FirstClass('a', 10)
72
What is overloading?
Same method name with different parameters
73
Inheritance
Creating a subclass by extending a superclass
74
Overriding
Redefining a super method in the subclass
75
Relationships
Uses - class uses method/data of another class Has - class has instance of another class/method Is - is a subclass of another class
76
Super keyword
Calls super class
77
How can subclasses directly access and use private members?
Use super.get or super.set methods
78
You can extend from how many classes?
One
79
What is shared with extended class?
All methods
80
Upcasting
Cast subclass to superclass type Shares methods and data of superclass
81
Upcasting is implicit. Tor F?
True
82
Downcasting is implicit. T or F?
False. Explicit
83
Static methods can not access instance data. T or F?
True
84
Instance methods can not access static data. T or F?
False. They can access static data
85
Recursion
Method repeatedly calls itself
86
Iteration
Method uses loops without repeatedly calling itself