Comp Sci Ch. 2 Flashcards Preview

Comp Sci > Comp Sci Ch. 2 > Flashcards

Flashcards in Comp Sci Ch. 2 Deck (60)
Loading flashcards...
0

What is an object?

Part of a java program that represents a real object

1

What is an attribute?

An objects values that represent its state

2

What is a method?

A group of programming statements given a name so we can use them when we need them

3

What is a class?

The data-type/blueprint of an object. Represents a concept

4

What is encapsulation?

The means by which an object protects and manages its own info

5

What is inheritance?

The means by which a class can be created by other classss

6

What is polymorphism?

The idea by which we we can refer to objects if different but related types in the same way

7

What do we directly interact with in programs?

Objects

8

Can there be multiple objects in a class?

Yes

9

What do methods do?

The functions of the program

10

This is when one class can be used to derive other classes

Inheritance

11

What is object and method in system.out.println ("hello world") ?

System.out is object. Println is method. Hello world is parameter

12

Where does the info we feed into a method considered?

Parameter

13

What is abstraction?

Hiding details

14

How do we know if something is abstract?

We don't need to think about the inner workings

15

What is a character string in java?

An object

16

What can you not do with a literal string?

Break it across two lines

17

What is contametation?

Splicing together multiple strings

18

What does a concatenator do?

String together numbers and letters working left to right

19

What do you use parentheses for in a concatenator?

To add stuff

20

What is an escape sequence?

A series of character that represent a special character

21

What is a variable a name for?

A location in memory

22

How do you declare a variable?

Specify it's name and the info it will hold

23

What changes the value of a variable?

An assignment statement

24

What must you specify when using a variable?

The variable type

25

What just you make sure you don't do when reassigning a variable?

Not put a data type again

26

What does putting final before a data type do?

Make it a constant

27

What are the data types for intergers?

Byte, short, int, and long

28

What are the data types for numbers with decimals?

Float and double

29

What is the data type for characters?

Char

30

What is the Boolean data type?

Boolean

31

What are booleans good
For?

True and false statements

32

What is a trade off of double?

It only allows 15 sig figs

33

What does % mean in java?

Remainder

34

What does the char function use?

Unicode

35

Why is the assignment operater a low precedence?

Cause the right side is finished then a value is assigned

36

What is a widening conversion?

Going from a data type with less bits to more bits

37

What is a bad data type conversion?

Int to double

38

What are 3 types of conversions?

Assignment, arithmetic promotion, and casing

39

What is assignment conversion?

Assigning an Internet variable to a double variable

40

What is arithmetic promotion?

Dividing a double and an interger to get another double?

41

What is casting?

Doing something and specifying the output data type

42

What are enumerated values?

Values outside of a class and the main method

43

What happens when we say to string something?

Memory is allocated for it

44

What is the process of creating an object?

Instantiation

45

Are strings powerful?

Yes

46

What do strings have on their own?

Their own class

47

What do index numbers start at?

0

48

What are strings?

Objects that you can use methods on, so they have special functionalities

49

How are interferes and doubles made into objects?

Wrapper class

50

What is autoboxing?

Converting a primitive data type into an object

51

What is a class library?

A collection of classes that contain methods

52

What is the java standard class library?

Additional functionalities that come with java

53

What classes are included in the java standard class library?

System and string

54

What is a package?

A collection of classes, methods, and more that can be shared with others

55

What do you do to use classes not readily in java?

Import them

56

What does a * mean?

The wild card-import all classes in a package

57

What is the scanner class?

A part of java.util that let's us get input from the user

58

What do applets not have?

A main method

59

What is an applet?

A java app meant to be run in a web browser