Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

Java, Midterm

Methods, 1D Arrays, and Formatting Outputs

QuestionAnswer
Method/Function Subroutines
Formal Parameters Defined in the method header. When the method is invoked we will be using the actual parameter.
Actual Parameters When a method is invoked you pass a value to the parameter. Also called argument.
Return Value Type The data type of the value the method returns
Return Statement Required for a value-return method.
A benefit of methods Reusable; don't have to repeat code (Modularizing). Hide the implementation from the user (Incapsulation). Reduce complexity, using the idea of divide and conquer. Also called the Stepwise Refinement. Decomposes the code into subproblems.
Libraries Give the coder access to additional features/tools.
Scanner (import java.util.Scanner;) Scans/reads/input strings into the console; based on the concept of scanning. Emphasizes platform independence. Also how Users can interact with program.
Method Overloading We use the same method name but with different argument types or number of arguments.
/**This comment is called java doc. */ These comments can be put in a separate document that help further describe/explain the code. Help build code documentation
Ambiguous Invocation When the method arguments are too similar,& there may be 2 or more possible matches for an invocation. Example: one method calls for a double while another calls for an int. Compiler can’t determine the match. Causes a compiler type of error.
Local variable A variable defined inside of a method.
Scope The part of the program where the variable can be referenced. The life of the variables. Once we are out of the method/loop/block/etc., that variable no longer exists. Must be declared before it can be used.
Abstract method Does not have a body. The body is provided by the subclass (inherited from). Process of hiding certain details and showing only essential information to the user.
Array A data structure that represents a collection of the same types of data. Must be logically related(the same data type)
How to declare an array double[] myList = new double[10];
How to declare and create an array in one line, if you know the size of the array. Datatype[] arrayRefVar = new datatype[arraySize];
A PROPERTY used to get the size of the array myList.length
When an array is created, its elements are assigned these Default Values; #s = 0, char = \u000, boolean = false
BASIL_FD Byte, Short, Int, Long, Float & Double (numeric primative data types from smallest to largest)
Indexed Variables How you normally navigate an array myList[i]
Create, declare, and initialize an array in one step double[] myList = {1.9, 2.9, 3.4, 3.5};
For Each also called The Enhanced For-Loop - -Helps to reduce the amount of code we need to write. Don’t need to reference size or index. Just go through every element in the array.
Garbage Collection Utility Areas of memory that Java can’t access it considers it garbage. It checks the memory and if it finds something unacceptable, it removes it from memory, throws it in the garbage and helps to clear up space in the memory.
Anonymous arrays Used once and discarded. Usefully if you know you only need array for a temporary purpose.
Java uses ______ to pass arguments to a method Pass by value
Heap The JVM stores the array in an area of memory, which is used for dynamic memory allocation where blocks of memory are allocated and freed in an arbitrary order.
Class and class are the same reserved word. False. Only if lowercase first letter.
A value can be more than one data type. False. Only one.
compile AND THEN we interpret True
&& has a HIGHER precedence than || True
String can be written as string and mean the same thing. False. Always uppercase first letter.
Values are not assigned in the condition. True
Java compiler translates Java source code into _________. Java is not like other languages that DO compile it into machine code. JavaBytecode
How is Java robust Java tries to catch errors as the code is being written. Not after it’s compiled.
White spaces mean... Nothing
What is the engine that allows Java to be platform independent? The JVM(Java Virtual Machine).
What is used for writing(and compiling) a program? JDK
Created by: Tain45
Popular Math sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards