Looking at variable types and different data types in Java.
This variable is declared inside the body of the method.
Static variables are initalised first before instance variables.
These variables exist outside of method declarations and specific to objects.
int num = 10;
long num = 12390234;
float floatNum = 3.58f
double doubleNum = 0.25;
boolean exampleBoo = false;
char letters = 'k';
String pieceOfText = "test";
int myArr = new int[10];
public class Example {
static int test = 100;
voice methodExample() {
string myStr = "local variable";
}
public static void main(String args[]) {
double instanceVar = 0.0038203;
}
}
Part three will look at object oriented programming.