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;
157 Cards in this Set
- Front
- Back
What does "this" represent in getters and setters
|
Denotes a reference to an implicit Parameter and to call another constructor of the same class
|
|
A class typically contains what 3 things
|
fields for data
constructors to create objects methods getters and setters in that order |
|
What does the get method do
|
it only looks up the state of an object and reports on it
|
|
What does the set and add method do
|
modify the state of an object
|
|
What are methods that change instance fields called
|
mutator methods
|
|
What are methods that only access instance fields called
|
accessor methods
|
|
What is a class
|
A template or blueprint from which objects are made
|
|
What are you doing when you construct an object from a class
|
You have created an Instance of the class
|
|
What is encapsulation
|
Information hiding the implementation details from the user of an object
|
|
What is Inheritance
|
When you extend an existing class that has all the properties of an existing class and adds more to it
|
|
What is the data in an object called?
|
Instance Fields
|
|
What are the procedures that operate on data called
|
Methods
|
|
What is the best standards for a class in terms of what comes first and second
|
Methods come first
and then fields |
|
What does Public mean
|
It means its available to any other code in the program
|
|
What does the word Void mean
|
Indicates the method will not return a value
|
|
When do you use Static
|
When you want to keep track of some information shared by all the members of a class OR When it doesn't make sense to have more than one instance of a property or method
|
|
What is an expression
|
A piece of code that evaluates to a single value like 2 + 2
|
|
What is a statement
|
a full sentence that end with a semi colon like a = 3
|
|
How is encapsulation attained
|
In the spirit of encapsulation it is common to make fields private. This means that they can only be directly accessed from the Bicycle class. We still need access to these values however. This can be done indirectly by adding public methods that obtain the field values for us
|
|
What do Methods do
|
They operate on objects and access their Instance Fields
|
|
A method has two parameters and in dave.raisesalary(5) what are they called and which is which
|
dave is the Implicit Parameter and the number inside the parentheses is the Explicit Parameter
|
|
In every method what does the key word THIS imply
|
That the word that follows is an implicit Parameter
|
|
Does this have an Implicit Parameter Math.pow(x comma a)
|
No because it does not use a math object to carry out its task
|
|
What is Implicit in this X.F(param)
|
X is implicit and Param is Explicit
|
|
What is Java EE and what does it stand for
|
Enterprise Edition it is designed to run on servers and it is scalable to multiple Server Applications
|
|
API
|
application program interface is a set of routines protocols and tools for building software applications. A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together.
|
|
Servlet
|
A small program that runs on a server.
|
|
JVM
|
Java Virtual Machine
|
|
What is Java sensitive about
|
Case Sensitive
|
|
What is Public Private called
|
Access Modifier they control the level of access other parts of the program have to the code
|
|
In terms of Java, what should the key word CLASS remind you of with this language?
|
everything in Java lives in a class
|
|
How should you think of a Class
|
as a container for the program logic that defines the behavior of the application
|
|
What follows the Class keyword
|
The name of the class
|
|
What must Class names start with and what can they be named
|
The must begin with an uppercase letter after that they can be letters of numbers and the length is almost unlimited
|
|
What are the standard naming conventions in a class
|
Class names are nouns that start with upper case letters if its multiple words use camelback
|
|
What names must match when it comes to Classes
|
The main Class and the name of the file must be the same
|
|
What happens when you compile a file
|
You end up with a file containing bytecodes for this Class
|
|
What code does the compiler always start with
|
the code in the main Method
|
|
What is another term for Method
|
function a methods performs some sort of function
|
|
What method must you have in your source file for your class to run
|
main method
|
|
Do you declare the main method public, private, protected?
|
Public
|
|
What do braces generally denote
|
parts usually blocks of code
|
|
What ends each Java statement
|
a semi colon and statements can span multiple lines
|
|
How should you think of Java statements
|
Sentences that end with a semi colon
|
|
When calling methods what is the typical syntax
|
object.method(parameters) like
|
|
What else are Parameters called
|
arguments
|
|
What is the minimum and maximum number of parameters
|
zero to infinity
|
|
If there are no parameters in a methods when must the method still have
|
empty parenthesis
|
|
Three ways of marking comments
|
// test here
|
|
What are the comment notation for automatic documentation
|
/** this will be automatically documents */
|
|
What is it called when every variable must declare type
|
Strongly Typed Language
|
|
What is Java Congruency
|
The programs must run with the sames results on all machines
|
|
What does the name Double type come from
|
Refers to the fact that it has twice the precision of float type
|
|
What do numbers of float type as a suffix on a number
|
an F like 3.402F with out the F they are always considered type Double
|
|
What are the three special floating-point values that denote overflows and errors
|
Positive infinity
|
|
What is the method to check for NaN
|
Not a Number
|
|
How do you do quotes included in the sentence
|
\" Like System.out.println("\"We will test this page test new line\"");
|
|
What does every variable have and what order
|
a type first then the name Like double salary int vacationDays
|
|
What can you name a variable
|
The first letter is a Letter and then letter and or numbers
|
|
Can you have multiple variable declarations of the same page
|
Yes but it is not recommended because of readability
|
|
Are variable names case sensitive
|
Yes you can had Variable and variable and the compiler thinks they are different variables
|
|
What do some programs give to variable names
|
Sometimes the name of the type. Like Box box
|
|
What do some programmers name their variables with another letter
|
Box aBox with aBox being the variable and Box the type
|
|
What must you do after declaring a variable
|
You must initialize it by means of an assignment statement
|
|
When declaring variable what is considered good practice
|
declare them as closely as possible to the point where they are going to first be used
|
|
With variable what is the key word Final denote
|
a constant which means you assign the variable once and then it is set once and for all
|
|
With variable constants what is it good practice to structure the name
|
ALL CAPS
|
|
What is the shortcut to X = X + 4
|
X +=4
|
|
What does Java is portability
|
A computation should yield the same results no matter which virtual machine executes it
|
|
What is the keyword to exercise strict floating-point
|
strictfp like
|
|
How do you increment or decrement a variable
|
n++ or n-- by one number
|
|
What operator do we use to test for equality
|
== Like
|
|
What operator do we use to test for inequality
|
!= Like
|
|
How do you short circuit an expression being evaluated if the firsrt one doesn't evaluate
|
expression1 && expression2 If the exp1 is shown to be false then exp2 is also false thus exp2 isn't evaluated Like x !=0 && 1/X. This will not allow a division be zero
|
|
expression1 || expression2
|
Condition first and if its true then exp1 is true if its not true then then exp2 is true Like x < y || X : Y
|
|
Which class contains mathematical function and constants
|
Math Class Like math.sqrt(x)
|
|
There is a subtle difference between println and the math class what is it
|
Println operates on an object the Math class does not and that is called static method
|
|
What is HTTP name
|
Hyper Text Transfer Protocol how to transfer data across the internet
|
|
Which directory does static web pages reside?
|
webdev folder
|
|
EJBs what are they
|
Enterprise Java Beans they represent verbs in the system like computeTax
|
|
Session Beans come in how many states and what are they
|
Stateless and Stateful
|
|
Annotations
|
User to specify additional information about a Class or Interface LIKE they can be used to specify if the session is stateless or stateful they always start with @ sign
|
|
GUI
|
A graphical user interface (GUI) is a human-computer interface (i.e. a way for humans to interact with computers) that uses windows icons and menus and which can be manipulated by a mouse (and often to a limited extent by a keyboard as well).
|
|
JNDI
|
Java Naming Directory Interface
|
|
What does void represent
|
The method does not return a value
|
|
What else is a method called when you are not being lazy
|
Method Declaration
|
|
What is the called that is used to call a Method Declaration?
|
Method Call e.g. fixthealternator(oldFord)
|
|
What is the first part of a method called the public fixcar {
|
Method Header
|
|
What is the method called after the curly braces of a method
|
Method body
|
|
What is the MAIN method, and what other method can call it?
|
They are recipes and the first method called into action when the program begins running. The main is never called by another method
|
|
What is a STATEMENT?
|
It is a sentence that tell the computer to do something like system.out.println
|
|
The API is just a bunch of what?
|
Code and the code perform actions for us that we can piece together to create a program
|
|
Never lose sight that Java Code is just what?
|
First and foremost an outline
|
|
What does this represent <% Java Code %>
|
JSP Code Snippet used to embed java code as opposed to declarations where you can embed methods
|
|
What does this represent <%! JAva Code %>
|
JSP declarations, they are used for Class level variable and methods that can be used throughout the page
|
|
What does this represent <%= Java %>
|
JSP Expressions like 5 * 2
|
|
What is the purpose of the Request object?
|
It represent the data submitted by the browser
|
|
What is the purpose of the Response object?
|
It represents the response that we are sending back to the client
|
|
What is the purpose of the Out object?
|
Represents output stream for the page, the content that will be sent back to the browser as the body of its response
|
|
What is a Javabean?
|
It's a Java class that conforms to a specific implementation pattern
|
|
What is the thing called that is stored in a variable?
|
a Value
|
|
AmountInAccount = 50.22 what is this statement called?
|
Assignment Statement
|
|
What is JSP
|
Java Server Page
|
|
What is MVC
|
Model - View - Controller
|
|
What allows a Servlet or JSP to execute another Servlet and/or JSP within the context of the same http request?
|
Request Dispatching. Java Object called RequestDispatcher
|
|
The instance fields hold values of an object the set of those values is what?
|
Their current state of that object and when you invoke a method on that object the state me be changed also
|
|
What is the key to making encapsulation work?
|
Have methods that never have direct access to the objects instance fields
|
|
What is the "cosmic superclass from which all others derive?
|
Object Class
|
|
When you are looking for what should be a class what is a simple rule of thumb?
|
Look for Nouns in the problem analysis, like Item, Order, Shipping Address, Payment, etc
|
|
When looking for what should be a method what is a good rule of thumb?
|
They are Verbs Like Add item to order, Cancel payment, Change shipping address
|
|
What , it called when a developer realizes that a method should never have been created in the first place?
|
Deprecated, and it is a good idea to stay away from deprecated methods, since there are better ones to replace them with
|
|
What is the deployment descriptor for the appilcation
|
the Web.xml file
|
|
What is the difference = or ==
|
= is an assignment to a variable and == is an equality check
|
|
Two type of data types?
|
Primitives and References
|
|
What are the primitive?
|
byte short int long float double char boolean
|
|
What are the References?
|
Arrays Classes and Interfaces
|
|
What is the difference between these two
age = 16 newAge = ++age newAge = age++ |
the first one is still 17 because the pre-Increment increase the number before assigning. The second one assigns age to newAge first and then increments it
|
|
What is the & sign
|
And
|
|
What is the | sign
|
Or
|
|
What is the ^ sign
|
Exclusive or
|
|
What is the ~ sign
|
Compliment
|
|
What is the ! symbol
|
Not
|
|
What is the && symbol
|
Short Circuit AND
If age<21 && hasId --java will not check the second condition if the first is not met |
|
What is the || symbol
|
Short Circuit OR
AcceptsCreditCards || HaveCash, if the first condition is true it will not check the second condition |
|
What are the two conversions and what does it mean
|
Implicit and Explicit
Implicit means the compiler will convert them automatically, explicit means you have to use the cast method |
|
How do you cast
|
with parenthesis like
like (double) 5. now the number is double or 5.0 |
|
What is the "\n" + "text" symbol
|
new line
|
|
What is the "\t" + "text" symbol
|
tab the text
|
|
How do you say 20 % 3 or i % 3
|
20 mod 3 or i mod 3
|
|
What is this and what does it do: max = (a > b) ? a : b; or
System.out.println("The larger number is: " + (first > second ? first:second)); |
The Ternary Operator. It's an operator, It simply checks the condition in the first section and then default to whichever one is true. It is handy because so many variable are checking one against the other
|
|
What are Strings
|
They are reference types not primitives. String is a class therefore it is capitalized
|
|
What are reference types
|
Means they point to a location in memory. Java hides the pointers while some programs allow you to get the memory address
|
|
When comparing two strings like
"jave" "java" what should you not use |
Do not use the == because it java checks the memory location not the actual string. Sometimes the compiler will store the same string in different memory locations. Remember strings point to memory locations. Use the stringbuilder method eqauls
|
|
What comparing two strings what method should you use
|
"string".equals("string") instead of the == symbol. Remember strings are references to memory only. and the same string may be in different memory locations depending on the compiler
|
|
Would this be true or false
"Java".equals("java") |
false, they are not equal because java strings are case sensitive and each of there references will be stored in different memories
|
|
With strings like "Java".equals("java") what method can you use that makes this equal regardless of case
|
equalsingnorecase, like
"Java".equalsignorecase("java") would make these equal |
|
What are items within an array called
|
Elements
|
|
In Arrays can there be mixed types or do all the types need to be the same?
|
All the types are the same
|
|
How are arrays referenced or referred to?
|
via an index and it starts at zero
|
|
There are three ways to declare an array?
|
int[] intArray;
String stringArray[]; object[] objectArray; |
|
When adding class constructors what is a good practice
|
Start with a default constructor. public cat(){YOU CAN ADD ALL OF YOUR DEFAULT VALUES HERE }
|
|
What are objects made from
|
The Class. the blueprint.
|
|
What defines an objects characteristics
|
The Class. The bueprint
|
|
What is an Entity?
|
It is an object -- the house, and the house was built from the Class--the blueprint
|
|
Can you have two methods with the same name
|
Yes but the parameter requirements must be different
|
|
Can we have two constructors in a Class
|
Yes like a default constructor which contains the fields defaulted
|
|
What is it called when you can have more than one method with the same name BUT different parameters
|
Method Overloading
|
|
Can you call the same method with different parameters (method overload) from the other method with the same name?
|
Yes e.g. you can can call eat() from eat(String food) method
|
|
Static means what
|
General to the class and not specific to an object or instance. Like certain plants that are toxic to all cats
|
|
What does final mean
|
It's a constant
|
|
What is an overloading constructor?
|
It's a Class that has more than one constructor, of course of the same name because all constructors have the name of the class
|
|
When is this used This();
|
When you are in a overloaded constructor and you want to call the default constructor
|
|
Cat c2 = new Cat() -- what is the c2 called?
|
Instance Variable Name
|
|
What is any part of Java that has a value
|
An Expression
|
|
What is the thing stored in a variable called
|
A Value
|
|
What are these called +=5 or ++ or -- or *=2, etc
|
Assignment operators
|
|
Anything that is not a primitive type is what?
|
A reference type
|