Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
63 Cards in this Set
- Front
- Back
What year was the Java programming language released to the public?
|
1995
|
|
Who created Java?
|
James Gosling
|
|
What is Object-oriented programming (OOP)?
|
software development methodology in which a program is conceptualized as a group of objects that work together.
|
|
Objects are created from templates called ...
|
Classes
|
|
classes contain _____ and the _______ required to use it.
|
data, statements
|
|
Platform neutrality is ...
|
run without modification in different environments or platforms
|
|
Java programs are transformed into a format called ________ that can be run by any computer or device equipped with a ____.
|
Byte-code, Java virtual machine or JVM
|
|
What are 3 ways Java is easier than C++
|
1) automatically memory allocation and de-allocation; 2) no pointers; 3) single inheritance
|
|
At a high level, how do you put together an OO program?
|
1) create objects; 2) connecting to each other or to existing objects
|
|
Describe an object
|
a self contained construct in memory which accomplishes specific tasks
|
|
Describe a class
|
A template used to create an object (bonus: a class is also loaded into memory, when its object is created.)
|
|
What is instantiation?
|
process of creating an object
|
|
What is an instance?
|
an accessible object in memory
|
|
What is the software development kit provided by Oracle, called?
|
JDK
|
|
What is Java SE, Java EE and the JDK?
|
These are the software libraries. SE is Standard Edition, EE is Enterprise Edition, JDK is the Java Development Kit.
|
|
What two distinct structures are found in a Java class?
|
Attributes and behaviours
|
|
Describe attributes
|
attributes are characteristics which describes state of an object
|
|
How are attributes defined in an object?
|
variables
|
|
What is an instance variable? What other term is often used?
|
storage location, specific to an instance of an object; object variable
|
|
What is a class variable?
|
Variable that is defined at the class level. Only one value is stored, no matter how many objects of the class have been created.
|
|
Describe behaviours
|
things that objects can do to themselves and possibly other objects
|
|
What are methods?
|
behaviours that perform specific tasks
|
|
Well designed Methods perform only ____ task.
|
One
|
|
Variables are limited to storage of specific types of data. Give two examples of data that can be stored in a string type variable.
|
regular text, directly assigned; the instance of another object as long as it was created from the string class
|
|
What is a type?
|
a way of classifying a piece of data; often used interchangeably with object
|
|
What is main()? How do you define it?
|
- TBD
|
|
What is meant by immutable?
|
can not be changed after it is set. If you try to change, a new object is created.
|
|
What is a primitive type?
|
Basic data types built into the language. Can be used without instantiation.
|
|
Methods, properties & data in a class are referred to as ...
|
Members
|
|
Describe inheritance
|
enables a class to inherit behaviour and attributes from another class
|
|
What is a subclass?
|
class which is inherited from a superclass
|
|
What is a superclass?
|
A class that is inherited from one level up the hierarchy
|
|
How many superclasses can you inherit from in Java?
|
one
|
|
What is the root superclass for everything in Java?
|
object
|
|
When you write a new class, what default class does it inherit from? How would you stop this default?
|
object; you can indicate that it is a superclass
|
|
When you call a method in a subclass, how does Java find it?
|
locates the method by looking through the class hierarchy, bottom up
|
|
When Java is looking through a hierarchy for a method call, how does it behave when there is more than one method with the same name and signature?
|
it uses the method it locates first, bottom up
|
|
What is overriding a method mean?
|
creating an implementation in a subclass, for a method that already exists in a superclass
|
|
What type of inheritance does Java support?
|
Single
|
|
What is an interface? (object interface not user interface) (2)
|
1) class with method names, but no definitions; 2) a contract which forces the implementation of specific methods, to ensure compatibility between different object types
|
|
What is a package in Java?
|
a way to group and hierarchically name classes and interfaces
|
|
What does the import statement allow?
|
provides a shortcut reference to a class from another package
|
|
How does Java, manage classes and their objects when a program is executed?
|
BOTH objects AND their classes are loaded into memory when needed
|
|
What is a generic?
|
a class or method without a type
|
|
A statement that produces a value is called an ________.
|
expression
|
|
The result produced by a statement is called its _______ ________.
|
return value
|
|
A group of statements grouped together using a { and }
|
block
|
|
Name three levels of Java variables
|
instance, class and local
|
|
Four ways to declare a variable in Java - use *int* as the type and *sample* as the var name
|
int sample; int sample1, sample2; int sample = value; int sample1 = value1, sample2 = value2;
|
|
T/F ? You can declare a local variable without assigning any value
|
False. The value may not be known while coding, but it must be assigned to at some point in time.
|
|
Variable names in Java must start with (3 items)
|
letter, underscore, $
|
|
T/F? Java is case-sensitive
|
True
|
|
Difference between Pascal Case and Camel Case
|
PascalCase capitalizes every word, eliminate spaces; camelCase capitalizes every successive word
|
|
Integer, byte is what size?
|
8 bits
|
|
Integer, short is what size?
|
16 bits
|
|
Integer, int is what size?
|
32 bits
|
|
Integer, long is what size?
|
64 bits
|
|
What is a Floating-point data type? Give two Java Floating-point types
|
numbers with a decimal point; float - for most uses; double - for very precise calculations
|
|
Data type best suited to handle single character and symbols
|
char
|
|
Difference between char and Char
|
char is a primitive data type; Char is a special Java class with similar functionality
|
|
What does void indicate?
|
used in methods to indicate that no value will be returned
|
|
Difference between = and ==
|
= is an assignment operator, == is a comparison operator
|
|
A _______ is a variable with a value that never changes.
|
constant
|