Kuppiya Module 1
Kuppiya Module 1
Kuppiya Module 1
Programming Languages
javac java
Source Code
Byte Code
.java
.class
Day - 1
Variable
int number = 10;
10
number
Data Types
// Floating Points
float f = 10.5F;
double d = 10.5;
//Single Charactor
char c = 'A';
char c1 = '\u0048';
char c2 = 87;
// True or False
boolean bool = true;
// Text
String str = "Hello Java";
}
}
char
class Example{
Operators public static void main(String args[]){
+ Addition int number1 = 20;
- Subtraction int number2 = 7;
/ Devision
// Addition
* Multiplication int answer = number1 + number2;
% Modulu
++ Increment // Subtraction
answer = number1 - number2;
-- Decrement
// Devision
double answer2 = (double)number1 / number2;
// Multiplication
X++ - Post Fix answer = number1 * number2;
++X - PreFix
// Modulu
int answer = number1 % number2;
int x = 10;
System.out.println(x); // 10
System.out.println(x++); // 10 PostFix
System.out.println(x); // 11
System.out.println(++x); // 12 PreFix
}
}
Scanner
import java.util.*;
class Example{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
System.out.print("Enter your number : ");
int number = input.nextInt();
System.out.println();
import java.util.*;
class Example{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
System.out.print("Enter Number 1 : ");
int number1 = input.nextInt();
System.out.println();