Study Guide Flashcards
(288 cards)
What is Compilation
The process a computer takes to convert high level language to machine code
What does it mean for Java to be strongly typed?
Every variable must be declared with a data type
What are primitive types?
Specifies the size and type of variable values and has no additional methods
What are the 8 primitive types in Java
byte
short
int
long
float
double
boolean
char
What is a method?
A collection of statements grouped together to perform an operation
What does ‘return’ do?
Finishes the execution of a method and returns a value
What is a return type?
A data type of the value returned from the method
What does the return type ‘void’ mean?
A method doesn’t return a value or contain a return statement
What is a method parameter?
Values passed into a method to manipulate
What are the different boolean operators?
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
&& Logical and
|| Logical or
! Logical not
What are Strings in Java?
Sequences of characters represented as an instance of the java.lang.String class
What is a Stack Trace?
List of method calls the application was in the middle of when an Exception was thrown
What is the main method?
Starting point for the JVM (Java Virtual Machine) to start execution of a Java program
What is the Syntax of the main method?
public static void main( String args[] ) {
{
What is OOP?
Object Oriented Programming. It organized software design around Data or Objects, rather than functions and logic
What are Objects?
Instances of a class
What makes an Object different from a Primitive Type?
Objects are user-defined, default value is null, kept in a heap, and the reference variable is kept in the stack
Primitive Types are pre-defined, can’t contain null value as the default, and kept in the stack
What is the relationship between a Class and an Object in Java?
Objects are the instances of Classes.
Classes are the “blueprint” for Objects
What are constructors?
Special methods used to initialize Objects
What is the default constructor?
Java compiler automatically creates a no arg constructor if we do not create any constructors
What is an Array?
A collection of similar data elements stored at contiguous memory location. Can be accessed directly by it’s index value
How do I get an element of an Array?
Calling the index number.
String[] fruit = {apple, orange, bananan};
System.out.println(fruit[1]); // gets element “orange”
What are the different flow control statements in Java?
if statements
for loops
while loops
do while loops
switch statements
How is a for loop written in Java?
for(int i = 0; i < 5; i++){
some code
}