2. Java codes: Adding 2 integers
• class Main {
• public static void main(String[] args) {
•
• int first = 10;
• int second = 20;
• // add two numbers
• int sum = first + second;
• System.out.println(first + " + " + second + " = " + sum);
• }
• }
3. Java code:Check whether a number is even or odd
• import java.util.Scanner;
• public class EvenOdd {
• public static void main(String[] args) {
• Scanner reader = new Scanner(System.in);
• System.out.print("Enter a number: ");
• int num = reader.nextInt();
• if(num % 2 == 0)
• System.out.println(num + " is even");
• else
• System.out.println(num + " is odd");
• }
• }
4. Order Symbol Name
1 ~ Tilde
2 `
Grave
Accent
3 !
Exclamation
Mark,
Ecphoneme
4 @ At Sign
5 #
Number
Sign, Hash,
Pound Sign
or
Octothorpe
6 $ Dollar
7 % Percent
8 ^ Caret
9 &
Ampersand
or And
10 * Asterisk
11 (
Open
Parenthesis
12 ) Close Parenthesis
13 ( ) Parenthesis
14 _ Underscore
15 –
Minus, Hyphen, en
dash, em dash
16 + Plus
17 = Equal
18 {
Open Brace, Open
Curly Bracket
19 }
Close Brace, Close
Curly Bracket
20 { }
Brace or Curly
Brackets
21 [
Open Square
Bracket
22 ] Close Square Bracket
23 [ ] Square Bracket
24 | Vertical Pipe
25 Back Slash
26 : Colon
27 ; Semicolon
28 " Quotation Marks
29 " "
Double Quotation
Marks
30 ' Apostrophe
31 ' '
Single Quotation
Marks
32 , Comma
33 < Less Than
34 > Greater Than
35 . Period, Dot
36 /
Slash (Forward
Slash), Solidus,
Virgule
37 ?
Question Mark,
Eroteme