Flashcards in Comp Sci Ch. 2 Deck (60)
What is an object?
Part of a java program that represents a real object
What is an attribute?
An objects values that represent its state
What is a method?
A group of programming statements given a name so we can use them when we need them
What is a class?
The data-type/blueprint of an object. Represents a concept
What is encapsulation?
The means by which an object protects and manages its own info
What is inheritance?
The means by which a class can be created by other classss
What is polymorphism?
The idea by which we we can refer to objects if different but related types in the same way
What do we directly interact with in programs?
Can there be multiple objects in a class?
What do methods do?
The functions of the program
This is when one class can be used to derive other classes
What is object and method in system.out.println ("hello world") ?
System.out is object. Println is method. Hello world is parameter
Where does the info we feed into a method considered?
What is abstraction?
How do we know if something is abstract?
We don't need to think about the inner workings
What is a character string in java?
What can you not do with a literal string?
Break it across two lines
What is contametation?
Splicing together multiple strings
What does a concatenator do?
String together numbers and letters working left to right
What do you use parentheses for in a concatenator?
To add stuff
What is an escape sequence?
A series of character that represent a special character
What is a variable a name for?
A location in memory
How do you declare a variable?
Specify it's name and the info it will hold
What changes the value of a variable?
An assignment statement
What must you specify when using a variable?
The variable type
What just you make sure you don't do when reassigning a variable?
Not put a data type again
What does putting final before a data type do?
Make it a constant
What are the data types for intergers?
Byte, short, int, and long
What are the data types for numbers with decimals?
Float and double
What is the data type for characters?
What is the Boolean data type?
What are booleans good
True and false statements
What is a trade off of double?
It only allows 15 sig figs
What does % mean in java?
What does the char function use?
Why is the assignment operater a low precedence?
Cause the right side is finished then a value is assigned
What is a widening conversion?
Going from a data type with less bits to more bits
What is a bad data type conversion?
Int to double
What are 3 types of conversions?
Assignment, arithmetic promotion, and casing
What is assignment conversion?
Assigning an Internet variable to a double variable
What is arithmetic promotion?
Dividing a double and an interger to get another double?
What is casting?
Doing something and specifying the output data type
What are enumerated values?
Values outside of a class and the main method
What happens when we say to string something?
Memory is allocated for it
What is the process of creating an object?
Are strings powerful?
What do strings have on their own?
Their own class
What do index numbers start at?
What are strings?
Objects that you can use methods on, so they have special functionalities
How are interferes and doubles made into objects?
What is autoboxing?
Converting a primitive data type into an object
What is a class library?
A collection of classes that contain methods
What is the java standard class library?
Additional functionalities that come with java
What classes are included in the java standard class library?
System and string
What is a package?
A collection of classes, methods, and more that can be shared with others
What do you do to use classes not readily in java?
What does a * mean?
The wild card-import all classes in a package
What is the scanner class?
A part of java.util that let's us get input from the user
What do applets not have?
A main method