-
compiler
translates our English into 0s and 1s for the processor to understand
-
source code
Human written code
-
byte code
a class file, which contains 0s and 1s also called machine code
-
case-sensitive language
Capital letters and lowercase letters are interpreted differently
-
public class
The start of every Java program and containsthe code: public class {}
-
main method
public static void main(String[ ] args) {}
-
Code to print to system?
System.out.println(“text”);
-
memory
What a computer uses to store information it needs
-
variable
is placeholder for data in a computer program
-
identifier
The name of a variable
-
keyword/reserved word
Words that are set aside for use in the Java language
-
int
Whole Numbers (5, 10, 100,-50)
-
double
Decimal Numbers (5.5,10.0583)
-
char
A single Character (‘A’,‘b’, ‘&’)
-
-
-
initialization of the variable
Giving a variable an initial value
-
-
How does Java compute concerning the equal sign?
The right side of the equal sign is computed first.
-
5 % 2 calculates what?
The remainder so the answer would be 1.
-
Syntax error
grammatical problem with the source code.
-
Runtime error
when your source code compiles, but when you execute it an error occurs
-
Logic error
is when the code has correct syntax, causes no errors during execution, but it produces undesired results
-
Comments
are sections of our source code that are ignored by the compiler
-
Single Line Comments
// comment
-
Area Comments
/* comment */
-
-
All _____ files start with public class and the name of the class?
Java
-
The ______ tells Java where your program should begin execution?
main method
-
promotion
When we divide two numbers where one is an int and the other is a double, the integer value is temporarily changed into a double for the operation.
-
casting
- When we want to force Java to temporarily change a value’s type, we can cast the type into something else.
- (double) 5 // Casts 5 into 5.0
-
constant
is a variable whose value can not be changed. Any attempt to do so will cause a syntax error.
-
how do we decade a variable as a constant?
- we use the keyword final before the declaration
- final double PI = 3.14;
-
methods
is a group of code that performs a single task
-
How does a simple method begin?
public static void ( ) {}
-
calling or invoking a method means what?
New methods you write must be told to run from the main method which is invoking or calling the method.
-
parameters
When a method needs information to complete its task, it accepts that information through the use of parameters
-
give an example of a parameter
public static void method(int x)
-
argument
The value you provide in the parenthesis gets stored into the parameter in the method. The value you provide is known as an argument
-
promotion with integers concerning doubles
Java will “promote” an integer value into a double value if an integer is given where a double is expected
-
local variable
Any variable declared inside a method only exists inside that method
-
A variable declared inside
a method is known as one that is ______ to
that method ?
local
-
class variables and instance variables
kinds of variables that may be used across every method
-
The Basic Method
public static void method_name(){}
-
Methods can send back a value to the location in which the method was called, this is called what?
returning a value
-
We write void in the method what does it mean?
void is written when the method does not return a value
-
If we want a method to return a value, we replace the word void with the data type that will be returned. What is this called?
This portion of the method signature is called the method’s return type
-
The Keyword return
To return a value, we use the keyword return, followed by the value to be returned.
-
tags
contained in a Javadoc and begins with @ and followed by author or version
-
How would you give someone information about your code without giving them source code?
javadoc
-
A example method signature is what?
public static <return_type> <method_name>(params) {….
-
public static <return_type> <method_name>(params) {} , define the bold terms
- Where return_type: is the type of value that the method returns. If nothing is returned, we use the keyword void
- method_name: is the name of your method
- params: are all the parameters the method uses to accept value
|
|