Shared Flashcard Set

Details

AP Comp Sci Terms
Final Prep Man!
83
Computer Science
Not Applicable
12/30/2003

Additional Computer Science Flashcards

 


 

Cards

Term
What is the main reason why computers are programmed.
Definition
So that they can perform tasks.
Term
Why do programmers develop computer programs.
Definition
To perform new tasks! HAHAHA.
Term
What lies at the heart of a computer?
Definition
CPU (Central Processing Unit)
Term
Where are Data and programs stored in a computer. (Hardware-wise)
Definition
Primary storage and secondary storage.
Term
Give 2 examples of primary storage.
Definition
SDRAM and DDRAM
Term
Give 2 examples of secondary memory.
Definition
Hard drive and floppy disks.
Term
Where does CPU read its machine instructions from?
Definition
haha, mermory.
Term
T/F: Does machine instructions depend on the CPU type?
Definition
F. Most of the time it does, but sometimes, Java Virtual Machine, it doesn't. This is caused because JVM has its own set of instructions on top of the cpu and therefore translates to different cpu.
Term
What are the format of Machine Instructions.
Definition
Binary numbers. 0 or 1
Term
What is Assembly language's purpose.
Definition
To make it easier to generate machine language. Machine language is a lot of numbers, and commanding a computer with a lot of numbers proves difficult.
Term
What is High-level language's purpose.
Definition
To make it easier to generate machine code. Java is an example. Another reason is that it helps you describe tasks at a higher conceptual level than machine code.
Term
What does a compiler do to Java code.
Definition
Translates the langauge into JVM code, called bytecode.
Term
T/F Java is case sensitive.
Definition
HAHA! True.
Term
What is the fundamental building block of Java programs.
Definition
Classes
Term
Each class contains definitions of what?
Definition
methods
Term
Each method contains sequence of what
Definition
instructions.
Term
What does every java application contain?
Definition
a class with a main method.
Term
Why do Yu and other professional programmers use comments.
Definition
To help dumb human readers understand the highly complicated programmers.
Term
What is the form of calling a method of another class.
Definition
OBJECT.METHOD(PARAMETERS)
Term
What is a String.
Definition
A sequence of characters enclosed in quotation marks.
Term
T/F Programming language does not have a set of rules.
Definition
False.
Term
What is a syntax error?
Definition
The violation of a set of rules a programming language has.
Term
What detects a syntax error?
Definition
the compiler.
Term
What is a logic error.
Definition
First of all, logic error is NOT A SYNTAX ERROR. Logic errors are actions that the program perform but the programmer did not attend.
Term
What is an editor? (in terms of computers)
Definition
program for entering and modifying text (Such as a java program)
Term
What does a java interpreter do?
Definition
runs a program, loading necessary bytecode from class files and library files.
Term
What do u manipulate in ur program when u invoke a method.
Definition
Objects.
Term
what do public interfaces do?
Definition
Specifies what you can do with the interface's objects. But the implementation is hidden altho they r carried out.
Term
What are, metaphorically, factories for objects?
Definition
Classes. HAHAHA
Term
What operator do u ues in order to construct a new object of a class.
Definition
new operator.
Term
Where do u store object locations?
Definition
object variables.
Term
T/F Not all object variables must be initialized before you access them.
Definition
HAHA, false.
Term
What does an object reference describe?
Definition
Object location.
Term
What are java packages?
Definition
Grouped classes.
Term
How do u use a class from another package?
Definition
Import them.
Term
What does a method definition specify?
Definition
The name of the method, parameters of the method, and the statements in which the method carries out.
Term
Where does an object store its state? (The data needed to excute its statements)
Definition
instance fields.
Term
T/F each object of a class has its own set of instance fields.
Definition
true
Term
Encapsulation
Definition
The process of hiding object data and providing methods for data access.
Term
What is the purpose of a constructor.
Definition
To contain instructions to initialize objects.
Term
which operator invokes a constructor.
Definition
new
Term
What r overloaded methods.
Definition
Methods with the same name but different parameter types.
Term
Abstraction
Definition
the process of finding the essential feature set for a class.
Term
T/F you don't have to initialize a instance field.
Definition
true
Term
T/F parameter variables and local variables stay when methods exits.
Definition
False
Term
What denotes the implicit parameter.
Definition
this acting as a parameter.
Term
final
Definition
once a value has been set and described with this constant, then the value cannot be changed.
Term
Does a static method operate on an object.
Definition
No
Term
What method do u use to prompt for input?
Definition
JOptionPane.showInputDialog
Term
What kind of program can u use System.exit(0)?
Definition
A program that has a graphical user interface.
Term
How do u read from a console?
Definition
Wrap System.in inside a BufferReader
Term
What exception should u tag in order to call the readLine method of BufferReader.
Definition
IOException
Term
What r the 3 types of Java programs
Definition
console application, applets, and graphics application.
Term
What r relational operators.
Definition
Operators that tests true or false. ==, >=, > <=, etc.
Term
What should be used to compare strings.
Definition
equals method. Not ==.
Term
compartTo
Definition
this method compares strings in dictionary order.
Term
what is a predicate method?
Definition
A method that returns a boolean value.
Term
When does one class depend on another?
Definition
When the class uses objects of that other class.
Term
coupling:
Definition
dependency between classes.
Term
What is the side effect of a method?
Definition
any eternally observable behavior outside the implicit parameter.
Term
can a method in Java change its primitive type parameter?
Definition
Nope. Not at all man.
Term
Who does Yu work for?
Definition
God, his angelic superior.
Term
How do you acquire a shadowed variable from a local field?
Definition
Use this.shadowed variable.
Term
Why do we prefer unit tests as opposed to other tests?
Definition
So we can test each class in isolation.
Term
What are boundary tests?
Definition
tests that test with the boundary inputs that r still valid by last to be valid.
Term
What is an oracle?
Definition
A slow but reliable method to compute s result for testing purpose.
Term
What is a test suite?
Definition
a set of tests for repeated testing.
Term
What is regression testing?
Definition
repeating previously run tests to ensure that known failures of prior versions do not appear in new versions of the software.
Term
What is black-box testing?
Definition
A testing method that does not take the structure of the implementation into account.
Term
What is White-box testing?
Definition
uses information about the structure of a program to test.
Term
What is Test coverage?
Definition
Measure of how many parts of a program have been tested.
Term
What is a program trace? (bet u don't know, I wage 1 penny)
Definition
Trace messaes that show the path of execution.
Term
What is a stack trace?
Definition
a list of all pending method calls at a particular point of time.
Term
What are the 3 concepts u need to know in order to master the debugger?
Definition
Breakpoints, single-stepping, and inspecting varaibles.
Term
T/F the debugger can show the absence of a bug?
Definition
False, the debugger can only analyze the precense of a bug?
Term
What is the difference between a Class and a Java interface?
Definition
A Class contains a bunch of stupid students trying to transform them into higher standing human beings. While an interface does not provide the implementations.
Term
How do u realize an interface?
Definition
By supplying all methods of the interface into the class that implements it.
Term
What is so good about a interface? (there are many answers)
Definition
reduce the coupling between classes.
Term
what does the instanceOf operator do?
Definition
It tests whether an object belongs to a particular type.
Term
Polymorphism
Definition
principle that behavior can vary depending on the actual ype of an object.
Term
What is early binding and what is late binding.
Definition
Early binding: when the compiler makes the selection of which class' method should be used when there is more than one candidate with the same method.
Late binding: when the program does the selection while its running.
Term
What's an inner class
Definition
classes declared inside another.
Term
T/F inner classes can access local variables?
Definition
False, the local variable must be declared final.
Supporting users have an ad free experience!