├── hello.java ├── typecon.java ├── arithmetic.java ├── stiudentinfo.java ├── nestedif.java └── switchcase.java /hello.java: -------------------------------------------------------------------------------- 1 | class hello 2 | { 3 | public static void main(String a[]) 4 | { 5 | System.out.print("hello world"); 6 | } 7 | } -------------------------------------------------------------------------------- /typecon.java: -------------------------------------------------------------------------------- 1 | public class typecon 2 | { 3 | public static void main(String []args) 4 | { 5 | int rno=117; 6 | double rnn=rno; 7 | System.out.println(rno); 8 | System.out.println(rnn); 9 | } 10 | } -------------------------------------------------------------------------------- /arithmetic.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | class add_1 3 | { 4 | public static void main(String args[]) 5 | { 6 | Scanner sc=new Scanner(System.in); 7 | System.out.println("enter values of a and b"); 8 | int a=sc.nextInt(); 9 | int b=sc.nextInt(); 10 | System.out.println(a+"+"+b+"is" +(a+b)); 11 | System.out.println(a+"-"+b+"is" +(a-b)); 12 | System.out.println(a+"*"+b+"is" +(a*b)); 13 | System.out.println(a+"/"+b+"is" +(a/b)); 14 | } 15 | } -------------------------------------------------------------------------------- /stiudentinfo.java: -------------------------------------------------------------------------------- 1 | public class stiudentinfo 2 | { 3 | public static void main(String[]args) 4 | { 5 | Student s=new Studenr("swapnikia","7117"); 6 | s.display(); 7 | } 8 | } 9 | class Student 10 | { 11 | string nam,rno; 12 | Student(String name,String rno) 13 | { 14 | nam=name; 15 | rn=rno; 16 | } 17 | public void display() 18 | { 19 | System.out,println("welcome %s rno is % \n"nam,rn) 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /nestedif.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class nestedif 3 | { 4 | public static void main(String[]args) 5 | { 6 | Scanner sc=new Scanner(System.in); 7 | System.out.println("enetr your fav iconic character"); 8 | String act=sc.nextLine(); 9 | if(act.equals("iron man")) 10 | { 11 | System.out.println("great choice"); 12 | System.out.println("enter"+act+"real name"); 13 | String reall=sc.nextLine(); 14 | if(reall.equalsIgnoreCase("tony start")) 15 | { 16 | System.out.println("cool actor"); 17 | } 18 | } 19 | else 20 | { 21 | System.out.println(act); 22 | } 23 | sc.close(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /switchcase.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class switchcase 3 | { 4 | public static void main(String[]args) 5 | { 6 | int a=8,b=8; 7 | Scanner sc=new Scanner(System.in); 8 | System.out.println("******"); 9 | System.out.println("*ARITHMETIC OPERATIONS"); 10 | System.out.println("1.ADD"); 11 | System.out.println("2.SUB"); 12 | System.out.println("3.MUL"); 13 | System.out.println("4.DIV"); 14 | System.out.println("ENETR YOUR CHOICE"); 15 | int ch=sc.nextInt(); 16 | switch(ch) 17 | { 18 | case 1-> System.out.println("addition is"+(a+b)); 19 | case 2-> System.out.println("subtraction is"+(a-b)); 20 | case 3-> System.out.println("multiplication is"+(a*b)); 21 | case 4-> System.out.println("addition is"+(a/b)); 22 | default->System.out.println("give proper option"); 23 | } 24 | sc.close(); 25 | } 26 | } --------------------------------------------------------------------------------