├── Lab-1 ├── Fibonacci │ ├── Fibonacci.class │ └── Fibonacci.java ├── Frequency │ ├── Frequency.class │ └── Frequency.java └── Transpose │ ├── Transpose.class │ └── Transpose.java ├── Lab-10 ├── QuickSort │ ├── quicksort.class │ └── quicksort.java └── sort │ ├── quicksort.class │ └── quicksort.java ├── Lab-2 ├── bankaccount │ ├── BankAccount.class │ └── BankAccount.java └── salary │ ├── Employee$Manager.class │ ├── Employee$Officer.class │ ├── Employee.class │ ├── Employee.java │ ├── Manager.class │ └── Officer.class ├── Lab-3 ├── Engineer │ ├── Employee.class │ ├── Employee.java │ ├── Engineer.class │ └── Engineer.java └── Shapes │ ├── Hexagon.class │ ├── Rectangle.class │ ├── Shape.class │ ├── Triangle.class │ ├── polygon.class │ └── polygon.java ├── Lab-4 ├── Hybrid.java └── Studpack │ ├── Hybrid.class │ ├── Hybrid.java │ ├── Result.class │ ├── Sports.class │ └── Student.class ├── Lab-5 ├── MultipleCatch │ ├── MultiCatch1.class │ └── MultiCatch1.java ├── NestedTry │ ├── NestedTry1.class │ └── NestedTry1.java ├── Throw │ ├── ThrowEx.class │ └── ThrowEx.java ├── Throws │ ├── Throws.class │ └── Throws.java └── TryFinally │ ├── TryFinallyEx.class │ ├── TryFinallyEx.java │ ├── TryFinallyEx2.class │ └── TryFinallyEx2.java ├── Lab-6 ├── FileHandling │ ├── FileHandling.class │ ├── FileHandling.java │ ├── f.txt │ ├── input.txt │ └── output.txt └── StringTokenizer │ ├── StringToToken.class │ └── StringToToken.java ├── Lab-7 ├── BinarySort │ ├── BinarySort.class │ └── BinarySort.java └── DoublyLinkedList │ ├── Dlinkedlist.class │ └── Dlinkedlist.java ├── Lab-8 ├── Thread1 │ ├── Multhread.class │ ├── Multithread.class │ ├── Multithread.java │ ├── X.class │ ├── Y.class │ ├── Z.class │ ├── even.class │ ├── odd.class │ └── test.class └── Thread2 │ ├── Demo.class │ ├── MultithreadSyn.class │ ├── MultithreadSyn.java │ ├── X.class │ └── Y.class ├── Lab-9 ├── Calculator │ ├── calculator$1.class │ ├── calculator$10.class │ ├── calculator$11.class │ ├── calculator$12.class │ ├── calculator$13.class │ ├── calculator$14.class │ ├── calculator$15.class │ ├── calculator$16.class │ ├── calculator$17.class │ ├── calculator$2.class │ ├── calculator$3.class │ ├── calculator$4.class │ ├── calculator$5.class │ ├── calculator$6.class │ ├── calculator$7.class │ ├── calculator$8.class │ ├── calculator$9.class │ ├── calculator.class │ └── calculator.java └── TrafficLight │ ├── traffic$1.class │ ├── traffic$2.class │ ├── traffic$3.class │ ├── traffic.class │ └── traffic.java └── javaFinalRecord ├── Combined └── mergedjava.pdf ├── FrontPages ├── 1.docx ├── 1.pdf ├── 2.odt ├── 2.pdf ├── 3.odt └── 3.pdf └── Record └── JavaFinalRecord.pdf /Lab-1/Fibonacci/Fibonacci.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-1/Fibonacci/Fibonacci.class -------------------------------------------------------------------------------- /Lab-1/Fibonacci/Fibonacci.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | class Fibonacci { 4 | 5 | public void fibo(int num) { 6 | 7 | System.out.println("\n The Fibnacci Series Upto " + num + " Is :\n"); 8 | 9 | int n1 = 0, n2 = 1; 10 | 11 | while (n1 < num) { 12 | 13 | System.out.println(n1); 14 | 15 | n2 = n1 + n2; 16 | n1 = n2 - n1; 17 | 18 | } 19 | 20 | } 21 | 22 | public static void main(String args[]) { 23 | 24 | Fibonacci obj1 = new Fibonacci(); 25 | 26 | System.out.println("Enter The Limit : "); 27 | Scanner sc = new Scanner(System.in); 28 | 29 | obj1.fibo(sc.nextInt()); 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /Lab-1/Frequency/Frequency.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-1/Frequency/Frequency.class -------------------------------------------------------------------------------- /Lab-1/Frequency/Frequency.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Frequency { 4 | 5 | public static void main(String args[]) { 6 | int count = 0; 7 | System.out.println("Enter The String :"); 8 | 9 | Scanner sc = new Scanner(System.in); 10 | String s = sc.nextLine(); 11 | 12 | System.out.println("Enter The Character To Find Frequency :"); 13 | 14 | String ch = sc.nextLine(); 15 | 16 | for (char c : s.toCharArray()) { 17 | if (Character.toLowerCase(c) == Character.toLowerCase(ch.charAt(0))) 18 | count++; 19 | } 20 | 21 | System.out.println("Frequency : " + count); 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Lab-1/Transpose/Transpose.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-1/Transpose/Transpose.class -------------------------------------------------------------------------------- /Lab-1/Transpose/Transpose.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Transpose { 4 | 5 | public static void main(String args[]) { 6 | int row, col; 7 | 8 | System.out.println("Enter The Number Of Column : "); 9 | Scanner sc = new Scanner(System.in); 10 | 11 | col = sc.nextInt(); 12 | 13 | System.out.println("Enter The Number Of Rows : "); 14 | row = sc.nextInt(); 15 | 16 | System.out.println("Enter The Matrix : "); 17 | 18 | int matrix[][] = new int[row][col]; 19 | 20 | for (int i = 0; i < row; i++) { 21 | for (int j = 0; j < col; j++) { 22 | 23 | matrix[i][j] = sc.nextInt(); 24 | 25 | } 26 | System.out.println(); 27 | } 28 | 29 | System.out.println("The Matrix Is : "); 30 | 31 | for (int i = 0; i < row; i++) { 32 | for (int j = 0; j < col; j++) { 33 | 34 | System.out.print(matrix[i][j] + " "); 35 | 36 | } 37 | System.out.println(); 38 | } 39 | 40 | System.out.println("Transpose Of The Matrix Is : "); 41 | 42 | int matrixt[][] = new int[col][row]; 43 | 44 | for (int i = 0; i < col; i++) { 45 | for (int j = 0; j < row; j++) { 46 | 47 | matrixt[i][j] = matrix[j][i]; 48 | System.out.print(matrixt[i][j] + " "); 49 | 50 | } 51 | System.out.println(); 52 | } 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Lab-10/QuickSort/quicksort.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-10/QuickSort/quicksort.class -------------------------------------------------------------------------------- /Lab-10/QuickSort/quicksort.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | //import java.lang.*; 3 | 4 | 5 | class quicksort{ 6 | 7 | 8 | String sortarr[]; 9 | int length; 10 | 11 | 12 | /*quicksort(){ 13 | 14 | }*/ 15 | 16 | //used to take input froom the user 17 | void input(){ 18 | 19 | int itr=0; 20 | Scanner sc = new Scanner(System.in); 21 | System.out.println("\n Total Number Of String "); 22 | length = sc.nextInt(); 23 | 24 | this.sortarr = new String[length]; 25 | 26 | while(length>itr){ 27 | 28 | System.out.print("\n "+(itr+1)+" th String : \n"); 29 | sortarr[itr] = sc.next(); 30 | itr++; 31 | 32 | } 33 | sort(0,length-1); 34 | 35 | 36 | } 37 | 38 | 39 | 40 | void sort(int l,int h){ 41 | 42 | int higher = h; 43 | int lower =l; 44 | 45 | String pivot = sortarr[lower+(higher-lower)/2]; 46 | 47 | while(lower<=higher){ 48 | 49 | while(sortarr[lower].compareToIgnoreCase(pivot)<0){ 50 | lower++; 51 | } 52 | 53 | while(sortarr[higher].compareToIgnoreCase(pivot)>0){ 54 | higher--; 55 | } 56 | 57 | if(lower<=higher){ 58 | 59 | swap(higher,lower); 60 | 61 | lower++; 62 | higher--; 63 | } 64 | 65 | } 66 | 67 | if(litr){ 27 | 28 | System.out.print("\n "+(itr+1)+" th String : \n"); 29 | sortarr[itr] = sc.next(); 30 | itr++; 31 | 32 | } 33 | sort(0,length-1); 34 | 35 | 36 | } 37 | 38 | 39 | 40 | void sort(int l,int h){ 41 | 42 | int higher = h; 43 | int lower =l; 44 | 45 | String pivot = sortarr[lower+(higher-lower)/2]; 46 | 47 | while(lower<=higher){ 48 | 49 | while(sortarr[lower].compareToIgnoreCase(pivot)<0){ 50 | lower++; 51 | } 52 | 53 | while(sortarr[higher].compareToIgnoreCase(pivot)>0){ 54 | higher--; 55 | } 56 | 57 | if(lower<=higher){ 58 | 59 | swap(higher,lower); 60 | 61 | lower++; 62 | higher--; 63 | } 64 | 65 | } 66 | 67 | if(l accBalance) { 42 | System.out.println("Cannot Withdraw Out Of Balance "); 43 | accinfo(); 44 | } else { 45 | accBalance -= draw; 46 | accinfo(); 47 | } 48 | 49 | } 50 | 51 | public static void main(String args[]) { 52 | 53 | // with default values Bankaccount// 54 | BankAccount bk = new BankAccount(); 55 | 56 | // using 57 | // parameterized// 58 | BankAccount acc1 = new BankAccount("DINOY RAJ", "AC101432", "SAVINGS", 100.0); 59 | acc1.deposit(20000.0); 60 | acc1.withdraw(1000.0); 61 | // low Balance 62 | BankAccount acc2 = new BankAccount("AMAL NATH", "AC101438", "SAVINGS", 100.0); 63 | acc2.deposit(2000.0); 64 | acc2.withdraw(100000.0); 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Lab-2/salary/Employee$Manager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-2/salary/Employee$Manager.class -------------------------------------------------------------------------------- /Lab-2/salary/Employee$Officer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-2/salary/Employee$Officer.class -------------------------------------------------------------------------------- /Lab-2/salary/Employee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-2/salary/Employee.class -------------------------------------------------------------------------------- /Lab-2/salary/Employee.java: -------------------------------------------------------------------------------- 1 | 2 | public class Employee { 3 | 4 | String name; 5 | int age; 6 | int phno; 7 | Double salary; 8 | String address; 9 | 10 | public void printSalary() { 11 | System.out.println("Salary: " + salary); 12 | } 13 | 14 | public void printInfo() { 15 | System.out.println("Name: " + name + "\nage: " + age + "\nphone number: " + phno + "\nSalary: " + salary 16 | + "\nAddress: " + address); 17 | } 18 | 19 | public static void main(String args[]) { 20 | 21 | System.out.println("::Dino Company Employee LIst ::\n"); 22 | Officer officer1 = new Officer("Amal nath", 18, 852634464, 200003.1, "Mangootil House Kannur", "HR"); 23 | officer1.printSalary(); 24 | officer1.printSpec(); 25 | Manager manager1 = new Manager("Dinoy Raj ", 19, 730618539, 100011.1, "Rennugeetham House Pokkunnu", "Design"); 26 | manager1.printSalary(); 27 | manager1.printdep(); 28 | 29 | } 30 | } 31 | 32 | class Officer extends Employee { 33 | 34 | String spec; 35 | 36 | Officer(String name, int age, int phno, Double salary, String address) { 37 | 38 | this.name = name; 39 | this.age = age; 40 | this.phno = phno; 41 | this.salary = salary; 42 | this.address = address; 43 | 44 | this.printInfo(); 45 | 46 | } 47 | 48 | Officer(String name, int age, int phno, Double salary, String address, String spec) { 49 | 50 | this.name = name; 51 | this.age = age; 52 | this.phno = phno; 53 | this.salary = salary; 54 | this.address = address; 55 | this.spec = spec; 56 | 57 | this.printInfo(); 58 | this.printSpec(); 59 | 60 | } 61 | 62 | public void printSpec() { 63 | System.out.println("Specialization: " + spec); 64 | } 65 | } 66 | 67 | class Manager extends Employee { 68 | 69 | String dep; 70 | 71 | Manager(String name, int age, int phno, Double salary, String address) { 72 | 73 | this.name = name; 74 | this.age = age; 75 | this.phno = phno; 76 | this.salary = salary; 77 | this.address = address; 78 | 79 | this.printInfo(); 80 | 81 | } 82 | 83 | Manager(String name, int age, int phno, Double salary, String address, String dep) { 84 | 85 | this.name = name; 86 | this.age = age; 87 | this.phno = phno; 88 | this.salary = salary; 89 | this.address = address; 90 | this.dep = dep; 91 | 92 | this.printInfo(); 93 | this.printdep(); 94 | 95 | } 96 | 97 | public void printdep() { 98 | System.out.println("Specialization: " + dep); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Lab-2/salary/Manager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-2/salary/Manager.class -------------------------------------------------------------------------------- /Lab-2/salary/Officer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-2/salary/Officer.class -------------------------------------------------------------------------------- /Lab-3/Engineer/Employee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Engineer/Employee.class -------------------------------------------------------------------------------- /Lab-3/Engineer/Employee.java: -------------------------------------------------------------------------------- 1 | package Lab-3.En gineer; 2 | 3 | public class Employee { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /Lab-3/Engineer/Engineer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Engineer/Engineer.class -------------------------------------------------------------------------------- /Lab-3/Engineer/Engineer.java: -------------------------------------------------------------------------------- 1 | 2 | class Employee { 3 | 4 | String Classname; 5 | Double Salary = 1000.0; 6 | 7 | void calcSalary(Double Salary) { 8 | 9 | System.out.println("Salary Of The Employee Is: " + Salary); 10 | 11 | } 12 | 13 | void display(String Classname) { 14 | System.out.println("Name Of The Class Is: " + Classname); 15 | } 16 | } 17 | 18 | public class Engineer extends Employee { 19 | 20 | void calcSalary(Double Salary) { 21 | 22 | System.out.println("Salary Of The Employee Is: " + Salary); 23 | 24 | } 25 | 26 | void calcSalary() { 27 | 28 | super.calcSalary(Salary); 29 | ; 30 | 31 | } 32 | 33 | public static void main(String args[]) { 34 | 35 | Engineer eg = new Engineer(); 36 | eg.display("Employee"); 37 | eg.calcSalary(); 38 | eg.calcSalary(2000.0); 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Lab-3/Shapes/Hexagon.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Shapes/Hexagon.class -------------------------------------------------------------------------------- /Lab-3/Shapes/Rectangle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Shapes/Rectangle.class -------------------------------------------------------------------------------- /Lab-3/Shapes/Shape.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Shapes/Shape.class -------------------------------------------------------------------------------- /Lab-3/Shapes/Triangle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Shapes/Triangle.class -------------------------------------------------------------------------------- /Lab-3/Shapes/polygon.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-3/Shapes/polygon.class -------------------------------------------------------------------------------- /Lab-3/Shapes/polygon.java: -------------------------------------------------------------------------------- 1 | 2 | abstract class Shape { 3 | 4 | abstract void numberOfSides(); 5 | } 6 | 7 | class Triangle extends Shape { 8 | 9 | void numberOfSides() { 10 | 11 | System.out.println("Triangle : 3"); 12 | } 13 | } 14 | 15 | class Rectangle extends Shape { 16 | 17 | void numberOfSides() { 18 | 19 | System.out.println("Rectangle : 4"); 20 | } 21 | } 22 | 23 | class Hexagon extends Shape { 24 | 25 | void numberOfSides() { 26 | 27 | System.out.println("Hexagon : 6"); 28 | } 29 | } 30 | 31 | public class polygon { 32 | 33 | public static void main(String args[]) { 34 | Triangle T1 = new Triangle(); 35 | Rectangle R1 = new Rectangle(); 36 | Hexagon H1 = new Hexagon(); 37 | 38 | T1.numberOfSides(); 39 | R1.numberOfSides(); 40 | H1.numberOfSides(); 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Lab-4/Hybrid.java: -------------------------------------------------------------------------------- 1 | import Studpack.*; 2 | 3 | public class Hybrid { 4 | 5 | public static void main(String args[]) { 6 | 7 | Result stud1 = new Result("Dinoy", 21, 30.0, 30.0, 30.0); 8 | Result stud2 = new Result("Dhanya", 22, 40.0, 45.0, 30.0); 9 | Result stud3 = new Result("Don", 23, 50.0, 50.0, 50.0); 10 | Result stud4 = new Result("Divya", 24, 34.0, 23.0, 3.0); 11 | Result stud5 = new Result("Diya", 25, 32.0, 50.0, 50.0); 12 | 13 | stud1.display(); 14 | stud2.display(); 15 | stud3.display(); 16 | stud4.display(); 17 | stud5.display(); 18 | 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /Lab-4/Studpack/Hybrid.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-4/Studpack/Hybrid.class -------------------------------------------------------------------------------- /Lab-4/Studpack/Hybrid.java: -------------------------------------------------------------------------------- 1 | package Studpack; 2 | 3 | interface Sports { 4 | int grade = 100; 5 | 6 | void display_grade(); 7 | 8 | } 9 | 10 | class Student { 11 | 12 | String name; 13 | int rollno; 14 | Double mark1, mark2, mark3; 15 | 16 | Student() { 17 | 18 | name = "Not Assigned"; 19 | rollno = 0; 20 | mark1 = mark2 = mark3 = 0.0; 21 | 22 | } 23 | 24 | Student(String name, int rollno, Double mark1, Double mark2, Double mark3) { 25 | 26 | this.name = name; 27 | this.rollno = rollno; 28 | this.mark1 = mark1; 29 | this.mark2 = mark2; 30 | this.mark3 = mark3; 31 | 32 | } 33 | 34 | } 35 | 36 | class Result extends Student implements Sports { 37 | 38 | Double total; 39 | 40 | public void display_grade() { 41 | 42 | System.out.println("Grade: " + grade); 43 | 44 | } 45 | 46 | public void display() { 47 | System.out.println("Roll No: " + rollno + "\nName: " + name); 48 | display_grade(); 49 | System.out.println("Total: " + total); 50 | } 51 | 52 | Result() { 53 | 54 | super(); 55 | total = 0.0; 56 | } 57 | 58 | Result(String name, int rollno, Double mark1, Double mark2, Double mark3) { 59 | super(name, rollno, mark1, mark2, mark3); 60 | total = mark1 + mark2 + mark3 + grade; 61 | } 62 | 63 | } 64 | 65 | public class Hybrid { 66 | 67 | public static void main(String args[]) { 68 | 69 | Result stud1 = new Result("Dinoy", 21, 30.0, 30.0, 30.0); 70 | Result stud2 = new Result("Dhanya", 22, 40.0, 45.0, 30.0); 71 | Result stud3 = new Result("Don", 23, 50.0, 50.0, 50.0); 72 | Result stud4 = new Result("Divya", 24, 34.0, 23.0, 3.0); 73 | Result stud5 = new Result("Diya", 25, 32.0, 50.0, 50.0); 74 | 75 | stud1.display(); 76 | stud2.display(); 77 | stud3.display(); 78 | stud4.display(); 79 | stud5.display(); 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Lab-4/Studpack/Result.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-4/Studpack/Result.class -------------------------------------------------------------------------------- /Lab-4/Studpack/Sports.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-4/Studpack/Sports.class -------------------------------------------------------------------------------- /Lab-4/Studpack/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-4/Studpack/Student.class -------------------------------------------------------------------------------- /Lab-5/MultipleCatch/MultiCatch1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-5/MultipleCatch/MultiCatch1.class -------------------------------------------------------------------------------- /Lab-5/MultipleCatch/MultiCatch1.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class MultiCatch1 { 4 | 5 | public static void main(String args[]) { 6 | 7 | // String s="dinoy"; 8 | try { 9 | 10 | int c = Integer.parseInt(args[0]); 11 | c = Integer.parseInt(args[1]) / Integer.parseInt(args[2]); 12 | char g = args[3].charAt(10); 13 | FileInputStream st = new FileInputStream("input.txt"); 14 | 15 | } catch (NumberFormatException e) { 16 | System.out.println(e.getMessage()); 17 | } catch (ArithmeticException e) { 18 | System.out.println(e.getMessage()); 19 | } catch (ArrayIndexOutOfBoundsException e) { 20 | System.out.println(e.getMessage()); 21 | } catch (FileNotFoundException e) { 22 | System.out.println(e.getMessage()); 23 | } 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Lab-5/NestedTry/NestedTry1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-5/NestedTry/NestedTry1.class -------------------------------------------------------------------------------- /Lab-5/NestedTry/NestedTry1.java: -------------------------------------------------------------------------------- 1 | 2 | public class NestedTry1 { 3 | 4 | public int dinoy() { 5 | return 1; 6 | } 7 | 8 | public static void main(String args[]) { 9 | try { 10 | char c = args[1].charAt(3); 11 | try { 12 | 13 | NestedTry1 nt = new NestedTry1(); 14 | nt = null; 15 | 16 | System.out.println(nt.dinoy()); 17 | 18 | } catch (NullPointerException e) { 19 | 20 | System.out.println("inner Exception : " + e.getMessage()); 21 | 22 | } 23 | } catch (ArrayIndexOutOfBoundsException e) { 24 | System.out.println("outer Exception : " + e.getMessage()); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Lab-5/Throw/ThrowEx.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-5/Throw/ThrowEx.class -------------------------------------------------------------------------------- /Lab-5/Throw/ThrowEx.java: -------------------------------------------------------------------------------- 1 | 2 | public class ThrowEx { 3 | 4 | public static void main(String[] args) { 5 | if (args.length != 1) { 6 | throw new RuntimeException("Input One Number Through Command Line"); 7 | } 8 | 9 | try { 10 | 11 | int d = Integer.parseInt(args[0]); 12 | 13 | } catch (NumberFormatException e) { 14 | System.out.println("Exception :" + e.getMessage()); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Lab-5/Throws/Throws.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-5/Throws/Throws.class -------------------------------------------------------------------------------- /Lab-5/Throws/Throws.java: -------------------------------------------------------------------------------- 1 | 2 | import java.io.*; 3 | 4 | public class Throws { 5 | 6 | public static void main(String args[]) throws FileNotFoundException, ArithmeticException { 7 | 8 | FileInputStream st = new FileInputStream("input.txt"); 9 | int a = 1 / 0; 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Lab-5/TryFinally/TryFinallyEx.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-5/TryFinally/TryFinallyEx.class -------------------------------------------------------------------------------- /Lab-5/TryFinally/TryFinallyEx.java: -------------------------------------------------------------------------------- 1 | 2 | import java.util.*; 3 | 4 | public class TryFinallyEx { 5 | 6 | public static void main(String args[]) { 7 | 8 | System.out.println("Enter The Value Of A And B : "); 9 | Scanner sc = new Scanner(System.in); 10 | 11 | int a = sc.nextInt(); 12 | int b = sc.nextInt(); 13 | 14 | try { 15 | 16 | int c = a / b; 17 | System.out.println(c); 18 | 19 | } catch (ArithmeticException e) { 20 | 21 | System.out.println("Exception Found : " + e); 22 | } finally { 23 | System.out.println("This One Will Excecute"); 24 | } 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Lab-5/TryFinally/TryFinallyEx2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-5/TryFinally/TryFinallyEx2.class -------------------------------------------------------------------------------- /Lab-5/TryFinally/TryFinallyEx2.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class TryFinallyEx2 { 4 | 5 | public static void main(String args[]) { 6 | int arr[] = new int[4]; 7 | System.out.println("Enter The 4 Numbers :"); 8 | Scanner sc = new Scanner(System.in); 9 | 10 | int i = 0; 11 | while (i < 4) { 12 | arr[i] = sc.nextInt(); 13 | i++; 14 | } 15 | 16 | try { 17 | System.out.println("Enter Index To Acess : "); 18 | System.out.println(arr[sc.nextInt() - 1]); 19 | } catch (ArrayIndexOutOfBoundsException e) { 20 | 21 | System.out.println(e.getMessage()); 22 | System.out.println(e.getStackTrace()); 23 | 24 | } finally { 25 | 26 | System.out.println("\nThis One Will Excecute"); 27 | i = 0; 28 | while (i < 4) { 29 | System.out.println(arr[i]); 30 | i++; 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Lab-6/FileHandling/FileHandling.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-6/FileHandling/FileHandling.class -------------------------------------------------------------------------------- /Lab-6/FileHandling/FileHandling.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class FileHandling { 4 | 5 | public static void main(String args[]) throws IOException { 6 | 7 | try { 8 | FileInputStream fi = new FileInputStream("input.txt"); 9 | FileOutputStream ft = new FileOutputStream("output.txt"); 10 | 11 | int i = 0; 12 | 13 | while ((i = fi.read()) != -1) { 14 | ft.write(i); 15 | } 16 | } catch (IOException e) { 17 | System.out.println("Exception " + e); 18 | } 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Lab-6/FileHandling/f.txt: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | class test implements Runnable { 4 | 5 | static int random; 6 | Random rand = new Random(); 7 | 8 | public void run() { 9 | 10 | random = rand.nextInt(10); 11 | System.out.println(random); 12 | } 13 | } 14 | 15 | class even implements Runnable { 16 | 17 | public void run() { 18 | 19 | if (test.random % 2 == 0) { 20 | System.out.println((int) Math.pow(test.random, 2) + "\n"); 21 | } 22 | } 23 | } 24 | 25 | class odd implements Runnable { 26 | 27 | public void run() { 28 | 29 | if (test.random % 2 != 0) { 30 | System.out.println((int) Math.pow(test.random, 3) + "\n"); 31 | } 32 | } 33 | } 34 | 35 | public class Multithread { 36 | 37 | public static void main(String[] args) { 38 | 39 | Thread ob = new Thread(new test()); 40 | Thread obe = new Thread(new even()); 41 | Thread obo = new Thread(new odd()); 42 | for (int i = 0; i < 10; i++) { 43 | 44 | try { 45 | Thread.sleep(1000); 46 | } catch (Exception e) { 47 | e.printStackTrace(); 48 | ob.start(); 49 | obe.start(); 50 | obo.start(); 51 | } 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /Lab-6/FileHandling/input.txt: -------------------------------------------------------------------------------- 1 | hello dinoy -------------------------------------------------------------------------------- /Lab-6/FileHandling/output.txt: -------------------------------------------------------------------------------- 1 | hello dinoy -------------------------------------------------------------------------------- /Lab-6/StringTokenizer/StringToToken.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-6/StringTokenizer/StringToToken.class -------------------------------------------------------------------------------- /Lab-6/StringTokenizer/StringToToken.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class StringToToken { 4 | 5 | public static void main(String[] args) { 6 | System.out.println("Enter The Line Of Integer :"); 7 | Scanner sc = new Scanner(System.in); 8 | String s = sc.nextLine(); 9 | 10 | StringTokenizer st = new StringTokenizer(s); 11 | 12 | int num, sum = 0; 13 | System.out.println("Digits : "); 14 | while (st.hasMoreTokens()) { 15 | num = Integer.parseInt(st.nextToken()); 16 | System.out.println(num); 17 | sum += num; 18 | 19 | } 20 | System.out.println("Sum :" + sum); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Lab-7/BinarySort/BinarySort.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-7/BinarySort/BinarySort.class -------------------------------------------------------------------------------- /Lab-7/BinarySort/BinarySort.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class BinarySort { 4 | 5 | public static void main(String args[]) { 6 | 7 | int num, i = 0; 8 | 9 | System.out.println("Enter The Number Of Digits: "); 10 | Scanner sc = new Scanner(System.in); 11 | 12 | num = sc.nextInt(); 13 | 14 | System.out.println("Enter The Digits (Ascending order): "); 15 | 16 | int arr[] = new int[num]; 17 | 18 | while (i < num) { 19 | 20 | arr[i] = sc.nextInt(); 21 | i++; 22 | 23 | } 24 | System.out.println("Enter The Digits To Search: "); 25 | 26 | int sr = sc.nextInt(); 27 | 28 | int l = 0, r = num - 1; 29 | int mid = 0; 30 | 31 | while (l <= r) { 32 | 33 | mid = (l + r) / 2; 34 | 35 | if (arr[mid] == sr) { 36 | break; 37 | } else if (arr[mid] > sr) { 38 | 39 | r = mid - 1; 40 | continue; 41 | 42 | } else { 43 | l = mid + 1; 44 | continue; 45 | } 46 | } 47 | 48 | if (l > r) { 49 | System.out.println("Elements Not Found ! "); 50 | } else if (arr[mid] == sr) { 51 | System.out.println(arr[mid] + " Found At Position " + mid); 52 | } 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Lab-7/DoublyLinkedList/Dlinkedlist.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-7/DoublyLinkedList/Dlinkedlist.class -------------------------------------------------------------------------------- /Lab-7/DoublyLinkedList/Dlinkedlist.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Dlinkedlist { 4 | 5 | public static void main(String args[]) { 6 | 7 | LinkedList ll = new LinkedList(); 8 | 9 | /* 10 | * System.out.println("Menu \n1.Insert\n2.delete\n3.display"); 11 | * 12 | * Scanner sc = new Scanner(System.in); 13 | * 14 | * switch (sc.nextInt()) { 15 | * 16 | * case 1: System.out.println("Enter The Element : "); ll.add(sc.nextLine()); 17 | * 18 | * case 2: System.out.println("Enter The Element To Delete : "); 19 | * ll.remove(sc.nextLine()); 20 | * 21 | * } 22 | */ 23 | ll.add("dinoy"); 24 | ll.add("dhanya"); 25 | ll.add("kuttan"); 26 | ll.add("deepu"); 27 | ll.add("sangi"); 28 | 29 | System.out.println("List After Insertion : "); 30 | 31 | Iterator itr = ll.iterator(); 32 | 33 | while (itr.hasNext()) { 34 | System.out.println(itr.next()); 35 | } 36 | 37 | ll.remove("dinoy"); 38 | ll.remove(2); 39 | 40 | System.out.println("List After Removing : "); 41 | 42 | Iterator rti = ll.iterator(); 43 | 44 | while (rti.hasNext()) { 45 | System.out.println(rti.next()); 46 | } 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Lab-8/Thread1/Multhread.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/Multhread.class -------------------------------------------------------------------------------- /Lab-8/Thread1/Multithread.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/Multithread.class -------------------------------------------------------------------------------- /Lab-8/Thread1/Multithread.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | 3 | class X implements Runnable { 4 | static int random; 5 | Random rand = new Random(); 6 | 7 | public void run() { 8 | random = rand.nextInt(25); 9 | System.out.println(random); 10 | } 11 | } 12 | 13 | class Y implements Runnable { 14 | public void run() { 15 | if (X.random % 2 == 0) 16 | System.out.println((int) Math.pow(X.random, 2) + "\n"); 17 | } 18 | } 19 | 20 | class Z implements Runnable { 21 | public void run() { 22 | if (X.random % 2 != 0) 23 | System.out.println((int) Math.pow(X.random, 3) + "\n"); 24 | } 25 | } 26 | 27 | class Multithread { 28 | public static void main(String args[]) { 29 | for (int i = 0; i < 10; i++) { 30 | Thread objX = new Thread(new X()); 31 | Thread objY = new Thread(new Y()); 32 | Thread objZ = new Thread(new Z()); 33 | try { 34 | Thread.sleep(1000); 35 | } catch (Exception e) { 36 | } 37 | objX.start(); 38 | objY.start(); 39 | objZ.start(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Lab-8/Thread1/X.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/X.class -------------------------------------------------------------------------------- /Lab-8/Thread1/Y.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/Y.class -------------------------------------------------------------------------------- /Lab-8/Thread1/Z.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/Z.class -------------------------------------------------------------------------------- /Lab-8/Thread1/even.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/even.class -------------------------------------------------------------------------------- /Lab-8/Thread1/odd.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/odd.class -------------------------------------------------------------------------------- /Lab-8/Thread1/test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread1/test.class -------------------------------------------------------------------------------- /Lab-8/Thread2/Demo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread2/Demo.class -------------------------------------------------------------------------------- /Lab-8/Thread2/MultithreadSyn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread2/MultithreadSyn.class -------------------------------------------------------------------------------- /Lab-8/Thread2/MultithreadSyn.java: -------------------------------------------------------------------------------- 1 | class Demo { 2 | public synchronized void display(int n, int t) { 3 | for (int i = n; i <= t; i++) { 4 | System.out.println(i * 5); 5 | try { 6 | Thread.sleep(400); 7 | } catch (Exception e) { 8 | System.out.println(e); 9 | } 10 | } 11 | } 12 | } 13 | 14 | class X extends Thread { 15 | Demo obj; 16 | 17 | X(Demo obj) { 18 | this.obj = obj; 19 | } 20 | 21 | public void run() { 22 | obj.display(1, 5); 23 | } 24 | } 25 | 26 | class Y extends Thread { 27 | Demo obj; 28 | 29 | Y(Demo obj) { 30 | this.obj = obj; 31 | } 32 | 33 | public void run() { 34 | obj.display(6, 10); 35 | } 36 | } 37 | 38 | class MultithreadSyn { 39 | public static void main(String args[]) { 40 | Demo obj = new Demo(); 41 | X objX = new X(obj); 42 | Y objY = new Y(obj); 43 | objX.start(); 44 | objY.start(); 45 | } 46 | } -------------------------------------------------------------------------------- /Lab-8/Thread2/X.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread2/X.class -------------------------------------------------------------------------------- /Lab-8/Thread2/Y.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-8/Thread2/Y.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$1.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$10.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$10.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$11.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$11.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$12.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$12.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$13.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$13.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$14.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$14.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$15.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$15.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$16.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$16.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$17.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$17.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$2.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$3.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$4.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$5.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$6.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$7.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$7.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$8.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$8.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator$9.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator$9.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/Calculator/calculator.class -------------------------------------------------------------------------------- /Lab-9/Calculator/calculator.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.*; 3 | import java.awt.event.*; 4 | 5 | public class calculator { 6 | 7 | calculator() { 8 | 9 | JFrame jrm = new JFrame(); 10 | jrm.setSize(500, 500); 11 | 12 | JLabel jbl = new JLabel("Calculator"); 13 | jbl.setBounds(227, 10, 400, 30); 14 | jrm.add(jbl); 15 | 16 | JTextField jtf = new JTextField(); 17 | jtf.setEditable(false); 18 | jtf.setBounds(50, 50, 400, 30); 19 | jrm.add(jtf); 20 | 21 | JButton b1, b2, b3, b4, b5, b6, b7, b8, b9, b0, bdiv, bmul, bsub, badd, bdec, beq, bdel, bclr, clear, dot; 22 | 23 | b1 = new JButton("1"); 24 | b2 = new JButton("2"); 25 | b3 = new JButton("3"); 26 | b4 = new JButton("4"); 27 | b5 = new JButton("5"); 28 | b6 = new JButton("6"); 29 | b7 = new JButton("7"); 30 | b8 = new JButton("8"); 31 | b9 = new JButton("9"); 32 | b0 = new JButton("0"); 33 | bdiv = new JButton("/"); 34 | bmul = new JButton("*"); 35 | bsub = new JButton("-"); 36 | badd = new JButton("+"); 37 | bdec = new JButton("."); 38 | beq = new JButton("="); 39 | clear = new JButton("Clear"); 40 | dot = new JButton("."); 41 | 42 | b7.setBounds(90, 100, 50, 40); 43 | b8.setBounds(180, 100, 50, 40); 44 | b9.setBounds(270, 100, 50, 40); 45 | bdiv.setBounds(360, 100, 50, 40); 46 | 47 | b4.setBounds(90, 170, 50, 40); 48 | b5.setBounds(180, 170, 50, 40); 49 | b6.setBounds(270, 170, 50, 40); 50 | bmul.setBounds(360, 170, 50, 40); 51 | 52 | b1.setBounds(90, 240, 50, 40); 53 | b2.setBounds(180, 240, 50, 40); 54 | b3.setBounds(270, 240, 50, 40); 55 | bsub.setBounds(360, 240, 50, 40); 56 | 57 | bdec.setBounds(90, 310, 50, 40); 58 | b0.setBounds(180, 310, 50, 40); 59 | beq.setBounds(270, 310, 50, 40); 60 | badd.setBounds(360, 310, 50, 40); 61 | clear.setBounds(200, 400, 90, 40); 62 | dot.setBounds(250, 470, 50, 40); 63 | 64 | jrm.add(b7); 65 | jrm.add(b8); 66 | jrm.add(b9); 67 | jrm.add(bdiv); 68 | jrm.add(b4); 69 | jrm.add(b5); 70 | jrm.add(b6); 71 | jrm.add(bmul); 72 | jrm.add(b1); 73 | jrm.add(b2); 74 | jrm.add(b3); 75 | jrm.add(bsub); 76 | jrm.add(bdec); 77 | jrm.add(b0); 78 | jrm.add(beq); 79 | jrm.add(badd); 80 | jrm.add(clear); 81 | jrm.add(dot); 82 | 83 | jrm.setLayout(null); 84 | jrm.setResizable(false); 85 | jrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 86 | jrm.setVisible(true); 87 | 88 | b1.addActionListener(new ActionListener() { 89 | public void actionPerformed(ActionEvent e) { 90 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 91 | jtf.setText(""); 92 | jtf.setText(jtf.getText() + "1"); 93 | } 94 | }); 95 | b2.addActionListener(new ActionListener() { 96 | public void actionPerformed(ActionEvent e) { 97 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 98 | jtf.setText(""); 99 | jtf.setText(jtf.getText() + "2"); 100 | } 101 | }); 102 | b3.addActionListener(new ActionListener() { 103 | public void actionPerformed(ActionEvent e) { 104 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 105 | jtf.setText(""); 106 | jtf.setText(jtf.getText() + "3"); 107 | } 108 | }); 109 | b4.addActionListener(new ActionListener() { 110 | public void actionPerformed(ActionEvent e) { 111 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 112 | jtf.setText(""); 113 | jtf.setText(jtf.getText() + "4"); 114 | } 115 | }); 116 | b5.addActionListener(new ActionListener() { 117 | public void actionPerformed(ActionEvent e) { 118 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 119 | jtf.setText(""); 120 | jtf.setText(jtf.getText() + "5"); 121 | } 122 | }); 123 | b6.addActionListener(new ActionListener() { 124 | public void actionPerformed(ActionEvent e) { 125 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 126 | jtf.setText(""); 127 | jtf.setText(jtf.getText() + "6"); 128 | } 129 | }); 130 | b7.addActionListener(new ActionListener() { 131 | public void actionPerformed(ActionEvent e) { 132 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 133 | jtf.setText(""); 134 | jtf.setText(jtf.getText() + "7"); 135 | } 136 | }); 137 | b8.addActionListener(new ActionListener() { 138 | public void actionPerformed(ActionEvent e) { 139 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 140 | jtf.setText(""); 141 | jtf.setText(jtf.getText() + "8"); 142 | } 143 | }); 144 | b9.addActionListener(new ActionListener() { 145 | public void actionPerformed(ActionEvent e) { 146 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 147 | jtf.setText(""); 148 | jtf.setText(jtf.getText() + "9"); 149 | } 150 | }); 151 | b0.addActionListener(new ActionListener() { 152 | public void actionPerformed(ActionEvent e) { 153 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 154 | jtf.setText(""); 155 | jtf.setText(jtf.getText() + "0"); 156 | } 157 | }); 158 | clear.addActionListener(new ActionListener() { 159 | public void actionPerformed(ActionEvent e) { 160 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 161 | jtf.setText(""); 162 | jtf.setText(""); 163 | } 164 | }); 165 | dot.addActionListener(new ActionListener() { 166 | public void actionPerformed(ActionEvent e) { 167 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 168 | jtf.setText(""); 169 | jtf.setText(jtf.getText() + "."); 170 | } 171 | }); 172 | badd.addActionListener(new ActionListener() { 173 | public void actionPerformed(ActionEvent e) { 174 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 175 | jtf.setText(""); 176 | jtf.setText(jtf.getText() + "+"); 177 | } 178 | }); 179 | bsub.addActionListener(new ActionListener() { 180 | public void actionPerformed(ActionEvent e) { 181 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 182 | jtf.setText(""); 183 | jtf.setText(jtf.getText() + "-"); 184 | } 185 | }); 186 | bmul.addActionListener(new ActionListener() { 187 | public void actionPerformed(ActionEvent e) { 188 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 189 | jtf.setText(""); 190 | jtf.setText(jtf.getText() + "X"); 191 | } 192 | }); 193 | bdiv.addActionListener(new ActionListener() { 194 | public void actionPerformed(ActionEvent e) { 195 | if (jtf.getText().equals("Enter two operands!") || jtf.getText().equals("Not defined!")) 196 | jtf.setText(""); 197 | jtf.setText(jtf.getText() + "/"); 198 | } 199 | }); 200 | 201 | beq.addActionListener(new ActionListener() { 202 | public void actionPerformed(ActionEvent e) { 203 | try { 204 | String S = jtf.getText(); 205 | int i = 0; 206 | char b = S.charAt(i); 207 | while (b != '+' && b != '-' && b != 'X' && b != '/' && b != '%') { 208 | i++; 209 | b = S.charAt(i); 210 | } 211 | Float x, y, ans = 0f; 212 | x = Float.parseFloat(S.substring(0, i)); 213 | y = Float.parseFloat(S.substring(i + 1, S.length())); 214 | if (b == '+') { 215 | ans = x + y; 216 | } else if (b == '-') { 217 | ans = x - y; 218 | } else if (b == 'X') { 219 | ans = x * y; 220 | } else if (b == '/') { 221 | ans = x / y; 222 | } 223 | if (b == '/' && y == 0) { 224 | jtf.setText("Not defined!"); 225 | } else { 226 | jtf.setText(ans + ""); 227 | } 228 | } catch (Exception ex) { 229 | jtf.setText("Enter two operands!"); 230 | } 231 | } 232 | }); 233 | } 234 | 235 | public static void main(String[] args) { 236 | new calculator(); 237 | } 238 | 239 | } 240 | -------------------------------------------------------------------------------- /Lab-9/TrafficLight/traffic$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/TrafficLight/traffic$1.class -------------------------------------------------------------------------------- /Lab-9/TrafficLight/traffic$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/TrafficLight/traffic$2.class -------------------------------------------------------------------------------- /Lab-9/TrafficLight/traffic$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/TrafficLight/traffic$3.class -------------------------------------------------------------------------------- /Lab-9/TrafficLight/traffic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/Lab-9/TrafficLight/traffic.class -------------------------------------------------------------------------------- /Lab-9/TrafficLight/traffic.java: -------------------------------------------------------------------------------- 1 | import java.awt.*; 2 | import java.awt.event.*; 3 | import javax.swing.*; 4 | 5 | public class traffic { 6 | traffic() { 7 | JFrame T = new JFrame("Traffic light"); 8 | JPanel p1 = new JPanel(); 9 | JPanel p2 = new JPanel(); 10 | JPanel p3 = new JPanel(); 11 | JPanel p4 = new JPanel(); 12 | JPanel p5 = new JPanel(); 13 | JPanel p6 = new JPanel(); 14 | JPanel p7 = new JPanel(); 15 | JRadioButton b[] = new JRadioButton[3]; 16 | ButtonGroup bg = new ButtonGroup(); 17 | b[0] = new JRadioButton("Start"); 18 | b[0].setBackground(Color.WHITE); 19 | b[1] = new JRadioButton("WAIT"); 20 | b[1].setBackground(Color.WHITE); 21 | b[2] = new JRadioButton("STOP"); 22 | b[2].setBackground(Color.WHITE); 23 | bg.add(b[0]); 24 | bg.add(b[1]); 25 | bg.add(b[2]); 26 | p1.setBackground(Color.BLACK); 27 | p2.setBackground(Color.BLACK); 28 | p3.setBackground(Color.BLACK); 29 | p4.setBackground(Color.BLACK); 30 | p5.setBackground(Color.BLACK); 31 | p6.setBackground(Color.BLACK); 32 | p7.setBackground(Color.BLACK); 33 | p2.add(p4); 34 | p2.add(b[0]); 35 | p2.add(p5); 36 | p2.add(b[1]); 37 | p2.add(p6); 38 | p2.add(b[2]); 39 | p2.add(p7); 40 | p2.setLayout(new GridLayout(1, 7)); 41 | T.add(p1); 42 | T.add(p2); 43 | T.add(p3); 44 | T.setSize(450, 300); 45 | T.setLayout(new GridLayout(3, 1)); 46 | T.setVisible(true); 47 | T.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 48 | b[0].addActionListener(new ActionListener() { 49 | public void actionPerformed(ActionEvent e) { 50 | b[0].setBackground(Color.GREEN); 51 | b[1].setBackground(Color.WHITE); 52 | b[2].setBackground(Color.WHITE); 53 | } 54 | }); 55 | b[1].addActionListener(new ActionListener() { 56 | public void actionPerformed(ActionEvent e) { 57 | b[0].setBackground(Color.WHITE); 58 | b[1].setBackground(Color.YELLOW); 59 | b[2].setBackground(Color.WHITE); 60 | } 61 | }); 62 | b[2].addActionListener(new ActionListener() { 63 | public void actionPerformed(ActionEvent e) { 64 | b[0].setBackground(Color.WHITE); 65 | b[1].setBackground(Color.WHITE); 66 | b[2].setBackground(Color.RED); 67 | } 68 | }); 69 | } 70 | 71 | public static void main(String[] args) { 72 | new traffic(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /javaFinalRecord/Combined/mergedjava.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/Combined/mergedjava.pdf -------------------------------------------------------------------------------- /javaFinalRecord/FrontPages/1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/FrontPages/1.docx -------------------------------------------------------------------------------- /javaFinalRecord/FrontPages/1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/FrontPages/1.pdf -------------------------------------------------------------------------------- /javaFinalRecord/FrontPages/2.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/FrontPages/2.odt -------------------------------------------------------------------------------- /javaFinalRecord/FrontPages/2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/FrontPages/2.pdf -------------------------------------------------------------------------------- /javaFinalRecord/FrontPages/3.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/FrontPages/3.odt -------------------------------------------------------------------------------- /javaFinalRecord/FrontPages/3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/FrontPages/3.pdf -------------------------------------------------------------------------------- /javaFinalRecord/Record/JavaFinalRecord.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinoy-raj/CSL203-OBJECT-ORIENTED-PROGRAMMING-LAB-IN-JAVA-KTU-S3-LAB/c184aeba9afdc14079d25bb85973418e7f44c796/javaFinalRecord/Record/JavaFinalRecord.pdf --------------------------------------------------------------------------------