Introduction To Java Programming
Introduction To Java Programming
Open Eclipse
File> New> Java Project>
Write Project Name
Right Click on src>New>class
Write a name for the class
Write the program
Run
Variables
Form:
TYPE NAME;
Example:
String foo;
Types
Assignment: =
Addition: +
Subtraction: -
Multiplication: *
Division: /
Order of Operations
1. Parentheses
2. Multiplication and division
3. Addition and subtraction
double x = 3 / 2 + 1; // x = 2.0
double y = 3 / (2 + 1); // y = 1.0
First Program
public class HelloWorld
{
}
}
Second Program
double copy=score;
System.out.println(copy);
System.out.println(score);
}
}
public class divide1
{