├── .gitignore ├── Abstract Method └── src │ └── Abstract │ ├── Animal.java │ ├── Bird.java │ ├── Human.java │ ├── Lion.java │ └── Main.java ├── ArithmeticOperator └── src │ └── arithmeticoperator │ ├── AreaOfCircle.java │ └── ArithmeticOperator.java ├── Array └── src │ └── array │ ├── Array.java │ ├── Array2D.java │ ├── Array3.java │ ├── ArrayList1.java │ ├── MaxAndMin.java │ ├── Multification.java │ ├── Sorting.java │ └── array2.java ├── ArrayList └── src │ ├── Practice │ └── PersonClass.java │ └── arraylist │ ├── Person2.java │ └── personList.java ├── Assignment [ ArrayList ] ├── build.xml ├── manifest.mf └── src │ ├── Assignment2 │ └── Animal.java │ └── assignment │ ├── Animal.java │ └── MyClass.java ├── Bank Account ├── build.xml ├── build │ └── classes │ │ └── bank │ │ └── account │ │ ├── Account.class │ │ ├── BankApp.class │ │ ├── Current.class │ │ └── Saving.class ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ └── bank │ └── account │ ├── Account.java │ ├── BankApp.java │ ├── Current.java │ └── Saving.java ├── Basic Java └── src │ ├── Object_Create │ └── Person.java │ ├── Show_Output_Input │ ├── Input_Show.java │ └── OutputShow.java │ └── basic_Operator │ ├── BitWise.java │ ├── BreakContinue.java │ ├── ConditionalDemo.java │ ├── Factorial.java │ ├── Fibonakki.java │ ├── MathDemo.java │ ├── MultiplicationTable.java │ ├── Palindrome_number.java │ ├── PrimeNumber.java │ ├── PrimeNumberCheck.java │ ├── Reverse.java │ ├── SumOfDigit.java │ └── User_Input_AND_output.java ├── Basic Using Loop └── src │ ├── Do_While │ ├── DoWhileLoop.java │ └── WhileLoop.java │ └── Loop │ ├── Loop.java │ └── UserInputLoop.java ├── Burger Bill Project └── src │ ├── Burger │ ├── Bill.java │ ├── Burger.java │ └── Main.java │ └── DeluxBurger │ └── DeluxBurger.java ├── Error_Handalling └── src │ ├── E_Output │ ├── Test.java │ ├── Test2.java │ ├── Test3.java │ ├── Test4.java │ ├── Test5.java │ ├── Test6.java │ ├── Test7.java │ └── Test8.java │ └── ExamQuestion │ └── Question.java ├── If Else └── src │ └── If_Else │ └── IfElse.java ├── Interface Method └── src │ ├── Interface │ ├── Bank.java │ ├── DBBL.java │ ├── IslamiBank.java │ └── TestInterface.java │ └── MultipleInterface │ ├── DemoClass.java │ ├── FirstIF.java │ ├── Main.java │ └── SecondIF.java ├── LICENSE ├── Multithreating Method └── src │ ├── A.java │ ├── B.java │ ├── Implements │ └── RunnableDemo.java │ ├── Main.java │ ├── RunnableThread │ ├── A.java │ └── B.java │ ├── Super │ ├── Bike.java │ ├── Veichle.java │ └── speed.java │ ├── Thread_Extends │ ├── A.java │ └── B.java │ └── multithreating │ ├── Multithread.java │ └── MultithreadingDemo.java ├── Object Oriented Programming BASIC Project ├── build.xml ├── build │ └── classes │ │ ├── Animal.class │ │ ├── Bird.class │ │ ├── Crocodile.class │ │ ├── Habits.class │ │ ├── Home.class │ │ ├── Human.class │ │ ├── Take_Input │ │ ├── getValue.class │ │ └── infoList.class │ │ └── TestClass.class ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ ├── Animal.java │ ├── Bird.java │ ├── Crocodile.java │ ├── Habits.java │ ├── Home.java │ ├── Human.java │ ├── Take_Input │ ├── getValue.java │ └── infoList.java │ └── TestClass.java ├── Pattern Java Code └── src │ └── pattern1 │ ├── pattern1.java │ ├── pattern2.java │ ├── pattern3.java │ └── pattern4.java ├── Practice Question Problem ├── build.xml ├── build │ └── classes │ │ ├── Final_Exam_Practice │ │ ├── Ball.class │ │ ├── Baseball.class │ │ ├── Football.class │ │ ├── MainClass.class │ │ ├── Rock.class │ │ └── Tossable.class │ │ ├── Problem27 │ │ ├── Animal.class │ │ ├── Cat.class │ │ ├── Dog.class │ │ ├── Exception28.class │ │ ├── ExceptionPropagationExample.class │ │ ├── Main.class │ │ └── Test.class │ │ ├── practice │ │ ├── DefaultConstractor.class │ │ ├── MethodOverloading.class │ │ └── Search.class │ │ └── problem │ │ ├── Department.class │ │ ├── Person.class │ │ ├── Student.class │ │ ├── Teacher.class │ │ └── Test.class ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ ├── Final_Exam_Practice │ ├── Ball.java │ ├── Baseball.java │ ├── Football.java │ ├── MainClass.java │ ├── Rock.java │ └── Tossable.java │ ├── Problem27 │ ├── Animal.java │ ├── Cat.java │ ├── Dog.java │ ├── ExceptionPropagationExample.java │ ├── Main.java │ └── Test.java │ ├── practice │ ├── DefaultConstractor.java │ ├── MethodOverloading.java │ └── Search.java │ └── problem │ ├── Department.java │ ├── Person.java │ ├── Student.java │ ├── Teacher.java │ └── Test.java ├── README.md └── SwitchCase └── src └── switchcase └── Switch.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | replay_pid* 25 | -------------------------------------------------------------------------------- /Abstract Method/src/Abstract/Animal.java: -------------------------------------------------------------------------------- 1 | 2 | package Abstract; 3 | 4 | public abstract class Animal { 5 | abstract void Move(); 6 | abstract void Eat(); 7 | 8 | void Life(){ 9 | System.out.println(" All Animal are alive ."); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Abstract Method/src/Abstract/Bird.java: -------------------------------------------------------------------------------- 1 | 2 | package Abstract; 3 | 4 | public abstract class Bird extends Animal { 5 | void Move(){ 6 | System.out.println("All birds can move ."); 7 | 8 | 9 | } 10 | void Eat(){ 11 | System.out.println("Birds are eat incets "); 12 | } 13 | void Fly(){ 14 | System.out.println("Bird Can Fly ."); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Abstract Method/src/Abstract/Human.java: -------------------------------------------------------------------------------- 1 | 2 | package Abstract; 3 | 4 | public abstract class Human extends Animal { 5 | void Move(){ 6 | System.out.println("Human can moves ."); 7 | } 8 | void Eat(){ 9 | System.out.println("Human eat Rice And Meat ."); 10 | } 11 | void Talk(){ 12 | System.out.println("Human can Talh to each Other ."); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Abstract Method/src/Abstract/Lion.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | public abstract class Lion extends Animal { 4 | void Eat(){ 5 | System.out.println("Lion eat Meat "); 6 | } 7 | void Move(){ 8 | System.out.println(" Lion can Move "); 9 | } 10 | void Hunt(){ 11 | System.out.println("Lion hunt animal ."); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Abstract Method/src/Abstract/Main.java: -------------------------------------------------------------------------------- 1 | 2 | package Abstract; 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | Human H1 = new Human() {}; 7 | Bird B1 = new Bird(){}; 8 | H1.Eat(); 9 | H1.Move(); 10 | H1.Talk(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ArithmeticOperator/src/arithmeticoperator/AreaOfCircle.java: -------------------------------------------------------------------------------- 1 | package arithmeticoperator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class AreaOfCircle { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner input = new Scanner(System.in); 10 | double base, height, area; 11 | 12 | System.out.print("Enter Base:"); 13 | base = input.nextDouble(); 14 | 15 | System.out.print("Enter Height:"); 16 | height = input.nextDouble(); 17 | 18 | area = 0.5 * base * height; 19 | System.out.print("Area=" + area); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ArithmeticOperator/src/arithmeticoperator/ArithmeticOperator.java: -------------------------------------------------------------------------------- 1 | package arithmeticoperator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class ArithmeticOperator { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner input = new Scanner(System.in); 10 | int num1, result, num2; 11 | 12 | System.out.print("Enter First number:"); 13 | num1 = input.nextInt(); 14 | 15 | System.out.print("Enter Second number:"); 16 | num2 = input.nextInt(); 17 | 18 | result = num1 + num2; 19 | System.out.println("sum =" + result); 20 | 21 | result = num1 - num2; 22 | System.out.println("Divine =" + result); 23 | 24 | result = num1 * num2; 25 | System.out.println("Multipile =" + result); 26 | 27 | result = num1 / num2; 28 | System.out.println("Division =" + result); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Array/src/array/Array.java: -------------------------------------------------------------------------------- 1 | package array; 2 | public class Array { 3 | public static void main(String[] args) { 4 | 5 | int [] number; 6 | number = new int[5]; 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Array/src/array/Array2D.java: -------------------------------------------------------------------------------- 1 | package array; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Array2D { 6 | public static void main(String[] args) { 7 | Scanner input = new Scanner(System.in); 8 | 9 | int[][]A = new int[3][3]; 10 | int[][]B = new int[3][3]; 11 | System.out.println("Enter A matrix Value="); 12 | for (int i = 0; i < 3; i++) { 13 | for (int j = 0; j < 3; j++) { 14 | System.out.printf("A[%d][%d]= ",i,j); 15 | A[i][j]= input .nextInt(); 16 | } 17 | System.out.println(); 18 | 19 | } 20 | System.out.print("A = "); 21 | for (int i = 0; i < 3; i++) { 22 | for (int j = 0; j < 3; j++) { 23 | System.out.print("\t"+A[i][j] ); 24 | } 25 | System.out.println(); 26 | } 27 | 28 | 29 | System.out.println("Enter B matrix Value="); 30 | for (int i = 0; i < 3; i++) { 31 | for (int j = 0; j < 3; j++) { 32 | System.out.printf("B[%d][%d]= ",i,j); 33 | B[i][j]= input .nextInt(); 34 | } 35 | System.out.println(); 36 | 37 | } 38 | System.out.print("B ="); 39 | for (int i = 0; i < 3; i++) { 40 | for (int j = 0; j < 3; j++) { 41 | System.out.print("\t"+B[i][j] ); 42 | } 43 | System.out.println(); 44 | } 45 | 46 | int[][]sum = new int[3][3]; 47 | 48 | for (int i = 0; i < 3; i++) { 49 | for (int j = 0; j < 3; j++) { 50 | sum[i][j] = A[i][j] + B[i][j]; 51 | 52 | } 53 | } 54 | 55 | System.out.println("The Sum of A And B Matrix = "); 56 | for (int i = 0; i < 3; i++) { 57 | for (int j = 0; j <3; j++) { 58 | System.out.print("\t"+sum[i][j]); 59 | 60 | } 61 | System.out.println(); 62 | 63 | } 64 | 65 | 66 | 67 | 68 | 69 | } 70 | 71 | } 72 | 73 | 74 | -------------------------------------------------------------------------------- /Array/src/array/Array3.java: -------------------------------------------------------------------------------- 1 | package array; 2 | 3 | public class Array3 { 4 | 5 | public static void main(String[] args) { 6 | 7 | String[] num = new String[4]; 8 | 9 | num[0] = " S. M."; 10 | num[1] = " Sajjad "; 11 | num[2] = " Hossain "; 12 | num[3] = " JIM "; 13 | 14 | for (int i = 0; i < num.length; i++) { 15 | System.out.print(num[i]); 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Array/src/array/ArrayList1.java: -------------------------------------------------------------------------------- 1 | package array; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class ArrayList1 { 6 | 7 | public static void main(String[] args) { 8 | ArrayList number = new ArrayList(); 9 | number.add(100); 10 | number.add(200); 11 | number.add(300); 12 | number.add(3, 400); 13 | System.out.println(+number.size()); 14 | System.out.println("Array lIST contain =" + number); 15 | //Sytem.out.println(number); 16 | /* for( int x : number){ 17 | System.out.println(" "+x); 18 | 19 | } */ 20 | number.remove(3); 21 | System.out.println("After Remove One Element =" + number); 22 | 23 | number.removeAll(number); 24 | System.out.print("After Remove All Number= " + number); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Array/src/array/MaxAndMin.java: -------------------------------------------------------------------------------- 1 | package array; 2 | import java.util.Scanner; 3 | public class MaxAndMin { 4 | public static void main(String[] args) { 5 | Scanner input = new Scanner(System.in); 6 | double[] num = new double[5]; 7 | double sum = 0; 8 | System.out.print("Enter 5 number = "); 9 | for (int i = 0; i < num.length; i++) { 10 | num[i] = input.nextDouble(); 11 | } 12 | for (int i = 0; i < num.length; i++) { 13 | sum = sum + num[i]; 14 | } 15 | System.out.println("Total number sof sum =" + sum); 16 | double max = num[0]; 17 | for (int i = 1; i < num.length; i++) { 18 | if(max=0; i--) { 15 | System.out.print(" "+number[i]); 16 | 17 | } 18 | System.out.println(""); 19 | 20 | String[] name ={"Jim","Siam","Kasem","Mr.Mango"}; 21 | Arrays.sort(name); 22 | for (int i = 0; i < 4; i++) { 23 | System.out.println(" "+name[i]); 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Array/src/array/array2.java: -------------------------------------------------------------------------------- 1 | package array; 2 | 3 | import java.util.Scanner; 4 | 5 | public class array2 { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | 10 | double[] num = new double[5]; 11 | double sum = 0; 12 | 13 | System.out.print("Enter 5 number = "); 14 | 15 | for (int i = 0; i < num.length; i++) { 16 | num[i] = input.nextDouble(); 17 | } 18 | 19 | for (int i = 0; i < num.length; i++) { 20 | sum = sum + num[i]; 21 | } 22 | double avg = sum / num.length; 23 | 24 | System.out.println("Avarage of number =" + avg); 25 | System.out.println("Total number sof sum =" + sum); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ArrayList/src/Practice/PersonClass.java: -------------------------------------------------------------------------------- 1 | package Practice; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Scanner; 5 | 6 | public class PersonClass { 7 | 8 | String name; 9 | int age; 10 | 11 | PersonClass(String name, int age) { 12 | this.name = name; 13 | this.age = age; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String Name) { 21 | this.name = Name; 22 | } 23 | 24 | public int getAge() { 25 | return age; 26 | } 27 | 28 | public void setAge(int age) { 29 | this.age = age; 30 | } 31 | 32 | public static void main(String[] args) { 33 | ArrayList personList = new ArrayList<>(); 34 | Scanner input = new Scanner(System.in); 35 | System.out.print(" Enter the Numbe of N = "); 36 | int N = input.nextInt(); 37 | 38 | for (int i = 0; i < N; i++) { 39 | System.out.print(" Entert Name : "); 40 | String pName = input.next(); 41 | 42 | System.out.print("Enter Age : "); 43 | int pAge = input.nextInt(); 44 | personList.add(new PersonClass(pName, pAge)); 45 | } 46 | for (int i = 0; i < personList.size(); i++) { 47 | personList.get(i).Display(); 48 | } 49 | } 50 | void Display() { 51 | System.out.println(" \n "); 52 | System.out.println(" Name : " + this.getName()); 53 | System.out.println(" Age : " + this.getAge()); 54 | System.out.println(""); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /ArrayList/src/arraylist/Person2.java: -------------------------------------------------------------------------------- 1 | package arraylist; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class Person2 { 6 | private String name; 7 | private int age; 8 | public Person2(String name, int age) { 9 | this.name = name; 10 | this.age = age; 11 | } 12 | 13 | public String getName() { 14 | return name; 15 | } 16 | 17 | public void setAge(String name) { 18 | this.name = name; 19 | } 20 | 21 | public void Display(){ 22 | System.out.println(" Name : "+this.name); 23 | System.out.println(" Age : "+this.age); 24 | } 25 | 26 | public static void main(String[] args) { 27 | ArrayList person2List = new ArrayList(); 28 | 29 | Person2 p1 = new Person2("Sajjad Jim",23); 30 | person2List.add(p1); 31 | Person2 p2 = new Person2("Siam",23); 32 | person2List.add(p2); 33 | 34 | person2List.add(new Person2("Labonno",23)); 35 | person2List.add(new Person2("Kubra",13)); 36 | 37 | 38 | 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ArrayList/src/arraylist/personList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template 4 | */ 5 | package arraylist; 6 | 7 | /** 8 | * 9 | * @author Sajjad Jim 10 | */ 11 | class personList { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Assignment [ ArrayList ]/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Object Oriented Assignment[ArrayList]. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Assignment [ ArrayList ]/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Assignment [ ArrayList ]/src/Assignment2/Animal.java: -------------------------------------------------------------------------------- 1 | package Assignment2; 2 | import java.util.ArrayList; 3 | import java.util.Scanner; 4 | 5 | public class Animal { 6 | String name; 7 | int age; 8 | String food; 9 | Animal(String name , int age , String food){ 10 | this.name = name; 11 | this.age = age; 12 | this.food = food; 13 | 14 | } 15 | void setName(String name){ 16 | this.name = name ; 17 | 18 | } 19 | void setAge(int age){ 20 | this.age = age; 21 | } 22 | void setFood(String food){ 23 | this.food = food ; 24 | } 25 | 26 | String getName(){ 27 | return name; 28 | } 29 | int getAge(){ 30 | return age; 31 | } 32 | String getFood(){ 33 | return food; 34 | } 35 | 36 | void Display(){ 37 | System.out.println("Name : "+this.name); 38 | System.out.println("Age : "+this.age); 39 | System.out.println("Food : "+this.food); 40 | System.out.println(); 41 | } 42 | public static void main(String[] args) { 43 | ArrayList animalList = new ArrayList<>(); 44 | Scanner input = new Scanner(System.in); 45 | System.out.print("Enter Animal Number :"); 46 | int N = input.nextInt(); 47 | 48 | System.out.println("\n"); 49 | 50 | for(int i= 0 ; i < N; i++){ 51 | System.out.print("Enter Animal Name : "); 52 | String aName = input.next(); 53 | 54 | System.out.print("Enter Age : "); 55 | int aAge = input.nextInt(); 56 | 57 | System.out.print("Enter Food : "); 58 | String aFood = input.next(); 59 | animalList.add(new Animal(aName,aAge,aFood)); 60 | System.out.println(); 61 | } 62 | 63 | System.out.println("\n ** Display Animal List ** \n"); 64 | for(int i = 0 ; i < animalList.size();i++) 65 | { 66 | animalList.get(i).Display(); 67 | } 68 | 69 | System.out.print("\nEnter age of Animal which You want to search : "); 70 | int animalAge = input.nextInt(); 71 | int flag = 0; 72 | 73 | for(int i = 0 ; i< animalList.size(); i ++){ 74 | if(animalAge == animalList.get(i).getAge()){ 75 | System.out.println("Found In "+(i+1)+" Number Serial Animal"); 76 | flag = 1; 77 | break; 78 | } 79 | } 80 | if(flag == 0){ 81 | System.out.println(" Not Found in Any Index "); 82 | } 83 | 84 | System.out.println("\n ** Edit Animal Information **"); 85 | System.out.print("Enter Index Number which you want to update :"); 86 | int IndexNumber =input.nextInt(); 87 | 88 | System.out.print("Enter new name : "); 89 | String nName = input.next(); 90 | System.out.print("Enter new Age : "); 91 | int nAge = input.nextInt(); 92 | System.out.print("Enter new Food : "); 93 | String nFood = input.next(); 94 | 95 | // animalList.add(IndexNumber, new Animal(nName,nAge,nFood)); 96 | 97 | animalList.get(IndexNumber).setName(nName); 98 | animalList.get(IndexNumber).setAge(nAge); 99 | animalList.get(IndexNumber).setFood(nFood); 100 | 101 | for(int i =0 ; i < animalList.size(); i++){ 102 | System.out.println("\n"); 103 | animalList.get(i).Display(); 104 | } 105 | 106 | System.out.println("** Remove The Information **"); 107 | int delete = input.nextInt(); 108 | animalList.remove(delete); 109 | 110 | System.out.println(" After Delete Information Display"); 111 | for (int i = 0; i < animalList.size(); i++) { 112 | System.out.println("Name : "+animalList.get(i).getName()); 113 | System.out.println("Age : "+animalList.get(i).getAge()); 114 | System.out.println("Food Name : "+animalList.get(i).getFood()); 115 | // animalList.get(i).Display(); 116 | } 117 | } 118 | } 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /Assignment [ ArrayList ]/src/assignment/Animal.java: -------------------------------------------------------------------------------- 1 | package assignment; 2 | 3 | public class Animal { 4 | 5 | String name; 6 | int age; 7 | String food; 8 | 9 | public Animal(String name, int age, String food) { 10 | this.name = name; 11 | this.age = age; 12 | this.food = food; 13 | } 14 | 15 | public void display() { 16 | 17 | System.out.println(" Name: " + this.name); 18 | System.out.println(" Age: " + this.age); 19 | System.out.println(" Food : " + this.food); 20 | 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public int getAge() { 32 | return age; 33 | } 34 | 35 | public void setAge(int age) { 36 | this.age = age; 37 | } 38 | 39 | public String getFood() { 40 | return food; 41 | } 42 | 43 | public void setFood(String food) { 44 | this.food = food; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assignment [ ArrayList ]/src/assignment/MyClass.java: -------------------------------------------------------------------------------- 1 | package assignment; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Scanner; 5 | 6 | public class MyClass { 7 | 8 | public static void main(String[] args) { 9 | 10 | ArrayList perList = new ArrayList<>(); 11 | 12 | Scanner input = new Scanner(System.in); 13 | System.out.print("Enter Number of Animal: "); 14 | int N = input.nextInt(); 15 | 16 | System.out.println("\n"); 17 | System.out.println("** Enter Animal Information **"); 18 | for (int i = 0; i < N; i++) { 19 | System.out.print("Enter name: "); 20 | String aName = input.next(); 21 | System.out.print("Enter age: "); 22 | int aAge = input.nextInt(); 23 | System.out.print("Enter Food: "); 24 | String aFood = input.next(); 25 | 26 | perList.add(new Animal(aName, aAge, aFood)); 27 | System.out.println("\n"); 28 | } 29 | 30 | System.out.println("**** Animal Information ****"); 31 | for (int i = 0; i < perList.size(); i++) { 32 | System.out.println((i + 1) + " Number Animal :"); 33 | perList.get(i).display(); 34 | System.out.println(""); 35 | } 36 | 37 | System.out.print("Enter age you want to search: "); 38 | int aAge = input.nextInt(); 39 | int flag = 0; 40 | 41 | for (int i = 0; i < perList.size(); i++) { 42 | 43 | if (aAge == perList.get(i).getAge()) { 44 | System.out.println("FOUND in " + (i + 1) + " Number Serial"); 45 | flag = 1; 46 | break; 47 | } 48 | } 49 | if (flag == 0) { 50 | System.out.println("Not FOUND"); 51 | } 52 | 53 | System.out.println(" ** Edit Information ** \n"); 54 | System.out.print("Enter index : "); 55 | int index = input.nextInt(); 56 | System.out.print("Enter new Name : "); 57 | input.nextLine(); 58 | String eName = input.nextLine(); 59 | System.out.print("Enter new Age : "); 60 | int eAge = input.nextInt(); 61 | System.out.print("Food name : "); 62 | String eFood = input.next(); 63 | 64 | // perList.add(new Animal(eName,eAge,eFood)); 65 | perList.get(index).setName(eName); 66 | perList.get(index).setAge(eAge); 67 | perList.get(index).setFood(eFood); 68 | 69 | System.out.println("** Animal Information Display After Edit **"); 70 | for (int i = 0; i < N; i++) { 71 | System.out.println("Name : " + perList.get(i).getName()); 72 | System.out.println("Age : " + perList.get(i).getAge()); 73 | System.out.println("Food : " + perList.get(i).getFood()); 74 | System.out.println("\n"); 75 | } 76 | 77 | System.out.println("Enter index to remove : "); 78 | int delete = input.nextInt(); 79 | perList.remove(delete); 80 | 81 | System.out.println(" Animal Information After Delete "); 82 | for (int i = 0; i < perList.size(); i++) { 83 | perList.get(i).display(); 84 | } 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /Bank Account/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Bank Account. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Bank Account/build/classes/bank/account/Account.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Bank Account/build/classes/bank/account/Account.class -------------------------------------------------------------------------------- /Bank Account/build/classes/bank/account/BankApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Bank Account/build/classes/bank/account/BankApp.class -------------------------------------------------------------------------------- /Bank Account/build/classes/bank/account/Current.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Bank Account/build/classes/bank/account/Current.class -------------------------------------------------------------------------------- /Bank Account/build/classes/bank/account/Saving.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Bank Account/build/classes/bank/account/Saving.class -------------------------------------------------------------------------------- /Bank Account/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Bank Account/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=8ba49aa5 2 | build.xml.script.CRC32=b930501b 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.106.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=8ba49aa5 7 | nbproject/build-impl.xml.script.CRC32=946a9899 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.106.0.48 9 | -------------------------------------------------------------------------------- /Bank Account/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\Sajjad JIM\\AppData\\Roaming\\NetBeans\\17\\build.properties 3 | -------------------------------------------------------------------------------- /Bank Account/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/E:/Object%20Oriented%20Program%20(%20Java%20)/Bank%20Account/src/bank/account/Current.java 7 | file:/E:/Object%20Oriented%20Program%20(%20Java%20)/Bank%20Account/src/bank/account/Saving.java 8 | file:/E:/Object%20Oriented%20Program%20(%20Java%20)/Bank%20Account/src/bank/account/BankApp.java 9 | file:/E:/Object%20Oriented%20Program%20(%20Java%20)/Bank%20Account/src/bank/account/Account.java 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Bank Account/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.modulepath=\ 22 | ${run.modulepath} 23 | debug.test.classpath=\ 24 | ${run.test.classpath} 25 | debug.test.modulepath=\ 26 | ${run.test.modulepath} 27 | # Files in build.classes.dir which should be excluded from distribution jar 28 | dist.archive.excludes= 29 | # This directory is removed when the project is cleaned: 30 | dist.dir=dist 31 | dist.jar=${dist.dir}/Bank_Account.jar 32 | dist.javadoc.dir=${dist.dir}/javadoc 33 | dist.jlink.dir=${dist.dir}/jlink 34 | dist.jlink.output=${dist.jlink.dir}/Bank_Account 35 | excludes= 36 | includes=** 37 | jar.compress=false 38 | javac.classpath= 39 | # Space-separated list of extra javac options 40 | javac.compilerargs= 41 | javac.deprecation=false 42 | javac.external.vm=true 43 | javac.modulepath= 44 | javac.processormodulepath= 45 | javac.processorpath=\ 46 | ${javac.classpath} 47 | javac.source=19 48 | javac.target=19 49 | javac.test.classpath=\ 50 | ${javac.classpath}:\ 51 | ${build.classes.dir} 52 | javac.test.modulepath=\ 53 | ${javac.modulepath} 54 | javac.test.processorpath=\ 55 | ${javac.test.classpath} 56 | javadoc.additionalparam= 57 | javadoc.author=false 58 | javadoc.encoding=${source.encoding} 59 | javadoc.html5=false 60 | javadoc.noindex=false 61 | javadoc.nonavbar=false 62 | javadoc.notree=false 63 | javadoc.private=false 64 | javadoc.splitindex=true 65 | javadoc.use=true 66 | javadoc.version=false 67 | javadoc.windowtitle= 68 | # The jlink additional root modules to resolve 69 | jlink.additionalmodules= 70 | # The jlink additional command line parameters 71 | jlink.additionalparam= 72 | jlink.launcher=true 73 | jlink.launcher.name=Bank_Account 74 | main.class=bank.account.BankApp 75 | manifest.file=manifest.mf 76 | meta.inf.dir=${src.dir}/META-INF 77 | mkdist.disabled=false 78 | platform.active=default_platform 79 | run.classpath=\ 80 | ${javac.classpath}:\ 81 | ${build.classes.dir} 82 | # Space-separated list of JVM arguments used when running the project. 83 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 84 | # To set system properties for unit tests define test-sys-prop.name=value: 85 | run.jvmargs= 86 | run.modulepath=\ 87 | ${javac.modulepath} 88 | run.test.classpath=\ 89 | ${javac.test.classpath}:\ 90 | ${build.test.classes.dir} 91 | run.test.modulepath=\ 92 | ${javac.test.modulepath} 93 | source.encoding=UTF-8 94 | src.dir=src 95 | test.src.dir=test 96 | -------------------------------------------------------------------------------- /Bank Account/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Bank Account 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Bank Account/src/bank/account/Account.java: -------------------------------------------------------------------------------- 1 | package bank.account; 2 | import java.util.Scanner; 3 | 4 | class Account { 5 | String customerName; 6 | int accountNumber; 7 | double balance; 8 | 9 | void deposit(double amount) { 10 | balance += amount; 11 | System.out.println("Deposit of Taka" + amount + " successful."); 12 | } 13 | 14 | void displayAccountDetails() { 15 | System.out.println("\nAccount Details :"); 16 | System.out.println("Customer Name: " + customerName); 17 | System.out.println("Account Number: " + accountNumber); 18 | System.out.println("Balance: Taka" + balance); 19 | } 20 | 21 | void withdraw(double amount) { 22 | if (balance >= amount) { 23 | balance -= amount; 24 | System.out.println("\nWithdrawal of Taka" + amount + " successful."); 25 | } else { 26 | System.out.println("Insufficient funds for withdrawal."); 27 | } 28 | } 29 | } 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Bank Account/src/bank/account/BankApp.java: -------------------------------------------------------------------------------- 1 | package bank.account; 2 | import java.util.Scanner; 3 | public class BankApp { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | // Creating a Saving Account 7 | Saving savingAccount = new Saving(); 8 | savingAccount.customerName = "Tanzina Teresa "; 9 | savingAccount.accountNumber = 234561778; 10 | savingAccount.balance = 10000.0; 11 | savingAccount.interestRate = 50.0; 12 | // Creating a Current Account 13 | Current currentAccount = new Current(); 14 | currentAccount.customerName = "Tanzina Teresa "; 15 | currentAccount.accountNumber = 789012; 16 | currentAccount.balance = 2000.0; 17 | currentAccount.minimumBalance = 50000.0; 18 | currentAccount.serviceCharge = 500.0; 19 | // Performing operations on Saving Account 20 | savingAccount.deposit(50000.0); 21 | savingAccount.computeAndDepositInterest(); 22 | savingAccount.withdraw(20000.0); 23 | savingAccount.displayAccountDetails(); 24 | // Performing operations on Current Account 25 | currentAccount.deposit(30000.0); 26 | currentAccount.checkMinimumBalance(); 27 | currentAccount.withdraw(22000.0); 28 | currentAccount.displayAccountDetails(); 29 | 30 | scanner.close(); 31 | } 32 | } -------------------------------------------------------------------------------- /Bank Account/src/bank/account/Current.java: -------------------------------------------------------------------------------- 1 | package bank.account; 2 | class Current extends Account { 3 | double minimumBalance; 4 | double serviceCharge; 5 | 6 | void checkMinimumBalance() { 7 | if (balance < minimumBalance) { 8 | balance -= serviceCharge; 9 | System.out.println("Minimum balance not maintained. Service charge of Taka" + serviceCharge + " applied."); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Bank Account/src/bank/account/Saving.java: -------------------------------------------------------------------------------- 1 | package bank.account; 2 | 3 | class Saving extends Account { 4 | double interestRate; 5 | 6 | void computeAndDepositInterest() { 7 | double interest = balance * interestRate / 100; 8 | balance += interest; 9 | System.out.println("Interest of Taka" + interest + " deposited."); 10 | } 11 | } -------------------------------------------------------------------------------- /Basic Java/src/Object_Create/Person.java: -------------------------------------------------------------------------------- 1 | package Object_Create; 2 | 3 | public class Person { 4 | 5 | String name; 6 | int age; 7 | 8 | public static void main(String[] args) { 9 | Person p = new Person(); // Create Object person = " p " 10 | p.name = "JIM"; 11 | p.age = 24; 12 | p.display(); // Method Call 13 | } 14 | 15 | public void display() { // Display method 16 | System.out.println("My name :" + name); 17 | System.out.println("My age :" + age); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Basic Java/src/Show_Output_Input/Input_Show.java: -------------------------------------------------------------------------------- 1 | package Show_Output_Input; 2 | 3 | public class Input_Show { 4 | 5 | int a, b; 6 | 7 | public static void main(String[] args) { 8 | 9 | Input_Show first1 = new Input_Show(); // Create Object 10 | 11 | first1.a = 60; 12 | first1.b = 70; 13 | 14 | int sum; 15 | 16 | System.out.println("Value of " + first1.a); 17 | System.out.println("Value of " + first1.b); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Basic Java/src/Show_Output_Input/OutputShow.java: -------------------------------------------------------------------------------- 1 | package Show_Output_Input; 2 | 3 | public class OutputShow { 4 | public static void main(String[] args) 5 | { 6 | System.out.println("S.M. SAJJAD HOSSAIN JIM"); 7 | System.out.println("01600******"); 8 | System.out.println("\"Java Programing\""); 9 | System.out.println("1 \t 2"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/BitWise.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class BitWise { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner input = new Scanner(System.in); 10 | int num1, num2; 11 | System.out.print("Enter two number="); 12 | num1 = input.nextInt(); 13 | num2 = input.nextInt(); 14 | 15 | int c; 16 | 17 | c = num1 & num2; 18 | System.out.println("A & B=" + c); 19 | 20 | c = num1 | num2; 21 | System.out.println("A | B=" + c); 22 | 23 | c = num1 ^ num2; 24 | System.out.println("A ^ B=" + c); 25 | 26 | c = num1 >> 2; 27 | System.out.println("Num1 >> 2=" + c); 28 | 29 | c = num2 >> 2; 30 | System.out.println("Num2 >> 2=" + c); 31 | 32 | c = num1 >> 2; 33 | System.out.println("Num1 >> 2=" + c); 34 | 35 | c = num2 << 2; 36 | System.out.println("Num2 << 2=" + c); 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/BreakContinue.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | public class BreakContinue { 4 | 5 | public static void main(String[] args) { 6 | 7 | int i = 1; 8 | for (i = 1; i <= 100; i++) { 9 | 10 | if (i == 10) { 11 | continue; //break; 12 | } 13 | System.out.println("Bangladesh"); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/ConditionalDemo.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class ConditionalDemo { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner input = new Scanner(System.in); 10 | int num1, num2, large; 11 | System.out.printf("Enter two number="); 12 | num1 = input.nextInt(); 13 | num2 = input.nextInt(); 14 | 15 | large = (num1 > num2) ? num1 : num2; 16 | 17 | System.out.println("Large number=" + large); 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/Factorial.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Factorial { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int n, fact = 1; 10 | System.out.print("Enter any number="); 11 | n = input.nextInt(); 12 | 13 | for (int i = n; i >= 1; i--) { 14 | 15 | fact = fact * i; 16 | 17 | } 18 | System.out.println("Factorial Of " + n + "=" + fact); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/Fibonakki.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Fibonakki { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int n; 10 | System.out.print("Enter How many number you want="); 11 | n = input.nextInt(); 12 | int first = 0, second = 1; 13 | int fibo; 14 | System.out.print(first + " " + second); 15 | for (int i = 0; i <= n; i++) { 16 | 17 | fibo = first + second; 18 | System.out.print(" " + fibo); 19 | first = second; 20 | second = fibo; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/MathDemo.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class MathDemo { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int x, y; 10 | System.out.print("Enter two number="); 11 | x = input.nextInt(); 12 | y = input.nextInt(); 13 | 14 | int max = Math.max(x, y); 15 | System.out.println("Maximun number=" + max); 16 | 17 | int min = Math.min(x, y); 18 | System.out.println("Minimum number=" + min); 19 | 20 | double pow = Math.pow(x, y); 21 | System.out.println("Power=" + pow); 22 | 23 | double pi = Math.PI; 24 | System.out.println("Pi value=" + pi); 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/MultiplicationTable.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | import java.util.Scanner; 3 | 4 | public class MultiplicationTable { 5 | 6 | public static void main(String[] args) { 7 | Scanner input = new Scanner(System.in); 8 | int num, multi = 1; 9 | 10 | System.out.print("Enter number="); 11 | num = input.nextInt(); 12 | 13 | for (int i = 1; i <= 10; i++) { 14 | multi = num * i; 15 | System.out.println(num + " X " + i + "=" + multi); 16 | } 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/Palindrome_number.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Palindrome_number { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int num, r, temp, sum = 0; 10 | 11 | System.out.print("Enter a number="); 12 | num = input.nextInt(); 13 | 14 | temp = num; 15 | 16 | while (temp != 0) { 17 | r = temp % 10; 18 | sum = sum * 10 + r; 19 | temp = temp / 10; 20 | } 21 | if (num == sum) { 22 | System.out.println("Palindrome number "); 23 | } else { 24 | System.out.println("Not Palindrome Number"); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/PrimeNumber.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class PrimeNumber { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int count = 0, num = 0; 10 | 11 | System.out.print("Enter a positive integer number="); 12 | num = input.nextInt(); 13 | 14 | for (int j = 2; j < num; j++) { 15 | 16 | if (num % 2 == 0) { 17 | count++; 18 | break; 19 | } 20 | } 21 | if (count == 0) { 22 | System.out.println("Prime Number"); 23 | } else { 24 | System.out.println("Not Prime Number "); 25 | } 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/PrimeNumberCheck.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class PrimeNumberCheck { 6 | public static void main(String[] args) { 7 | Scanner input= new Scanner (System.in); 8 | int m, n, count = 0; 9 | 10 | System.out.print("Enter the initial number: "); 11 | m = input.nextInt(); 12 | 13 | System.out.print("Enter the final number: "); 14 | n = input.nextInt(); 15 | 16 | for (int i = m; i <= n; i++) { 17 | for (int j = 2; j <= i-1; j++) { 18 | if(i%j==0){ 19 | count++; 20 | break; 21 | } 22 | } 23 | if(count==0){ 24 | System.out.println(i); 25 | count = 0; 26 | } 27 | 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/Reverse.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | import java.util.Scanner; 3 | public class Reverse { 4 | public static void main(String[] args) { 5 | Scanner input = new Scanner (System.in); 6 | int num , r, temp , sum=0; 7 | 8 | System.out.print("Enter a number="); 9 | num = input.nextInt(); 10 | 11 | temp = num; 12 | 13 | while(temp != 0){ 14 | r = temp % 10 ; 15 | sum = sum *10 + r; 16 | temp = temp / 10; 17 | } 18 | System.out.print("The digit of number ="+sum); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/SumOfDigit.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class SumOfDigit { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int num, r, temp, sum = 0; 10 | System.out.print("Enter a number="); 11 | num = input.nextInt(); 12 | temp = num; 13 | while (temp != 0) { 14 | r = temp % 10; 15 | sum = sum + r; 16 | temp = temp / 10; 17 | } 18 | System.out.print("The digit of number =" + sum); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Basic Java/src/basic_Operator/User_Input_AND_output.java: -------------------------------------------------------------------------------- 1 | package basic_Operator; 2 | 3 | import java.util.Scanner; 4 | 5 | public class User_Input_AND_output { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | 10 | System.out.print("Enter your name="); 11 | String name = input.nextLine(); 12 | System.out.println("Your name is " + name); 13 | 14 | System.out.print("Enter your age="); 15 | int age = input.nextInt(); 16 | System.out.println("Your age " + age); 17 | 18 | System.out.print("Enter your id number="); 19 | String id = input.next(); 20 | System.out.println("Your ID " + id); 21 | 22 | System.out.print("Enter your Department name="); 23 | String dpt = input.next(); 24 | System.out.println("Your department name " + dpt); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Basic Using Loop/src/Do_While/DoWhileLoop.java: -------------------------------------------------------------------------------- 1 | package Do_While; 2 | 3 | public class DoWhileLoop { 4 | public static void main(String[] args) { 5 | int i=6; 6 | do{ 7 | System.out.println("Bangladesh"); 8 | i++; 9 | }while(i<=5); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Basic Using Loop/src/Do_While/WhileLoop.java: -------------------------------------------------------------------------------- 1 | package Do_While; 2 | 3 | public class WhileLoop { 4 | public static void main(String[] args) { 5 | int i=1; 6 | while(i<=10){ 7 | System.out.println("Bangladesh"); 8 | i++; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Basic Using Loop/src/Loop/Loop.java: -------------------------------------------------------------------------------- 1 | package Loop; 2 | 3 | public class Loop { 4 | 5 | public static void main(String[] args) { 6 | 7 | for (int i = 1; i <= 100; i++) { 8 | System.out.println("S.M. Sajjad Hossain Jim"); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Basic Using Loop/src/Loop/UserInputLoop.java: -------------------------------------------------------------------------------- 1 | package Loop; 2 | 3 | import java.util.Scanner; 4 | 5 | public class UserInputLoop { 6 | 7 | public static void main(String[] args) { 8 | Scanner input = new Scanner(System.in); 9 | int n, result = 1; 10 | System.out.print("Enter number="); 11 | n = input.nextInt(); 12 | for (int i = 1; i <= n; i++) { 13 | 14 | System.out.print(i + " + "); 15 | result = result * i; 16 | 17 | } 18 | System.out.println("= " + result); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Burger Bill Project/src/Burger/Bill.java: -------------------------------------------------------------------------------- 1 | package Burger; 2 | public interface Bill { 3 | 4 | public void getWaterPrice(); 5 | public void getTeaPrice(); 6 | public void getBill(); 7 | } 8 | -------------------------------------------------------------------------------- /Burger Bill Project/src/Burger/Burger.java: -------------------------------------------------------------------------------- 1 | package Burger; 2 | public class Burger implements Bill{ 3 | public int price; 4 | public int baseBurgerPrice; 5 | public Boolean Bur; 6 | public int extraCheese = 70; 7 | public int teaPrice = 50; 8 | public int Water = 25; 9 | 10 | private Boolean extraSugerAdd= false; 11 | private Boolean extraWater= false; 12 | private Boolean extraTea = false; 13 | 14 | public Burger(Boolean Bur) { 15 | this.Bur = Bur; 16 | if(this.Bur){ 17 | this.price = 500; 18 | } 19 | else{ 20 | this.price = 400; 21 | } 22 | baseBurgerPrice = this.price; 23 | } 24 | 25 | public void addExtraCheese() 26 | { 27 | extraSugerAdd= true; 28 | this.price = price + extraCheese; 29 | } 30 | 31 | @Override 32 | public void getWaterPrice(){ 33 | extraWater= true; 34 | this.price = price +Water; 35 | } 36 | 37 | @Override 38 | public void getTeaPrice(){ 39 | extraTea = true; 40 | this.price = price + teaPrice; 41 | } 42 | 43 | @Override 44 | public void getBill(){ 45 | String Bill = ""; 46 | System.out.println("Burger Bill Only : "+this.baseBurgerPrice+" Taka"); 47 | 48 | if(extraSugerAdd){ 49 | Bill += "Extra Suger Added = " +extraCheese+ " Taka\n"; 50 | 51 | } 52 | if(extraWater){ 53 | Bill += "Water Order Done =" +Water+ " Taka\n"; 54 | 55 | } 56 | if(extraTea){ 57 | Bill += "Extra Tea Order Done = " +teaPrice+ " Taka \n"; 58 | 59 | } 60 | Bill += "Total Bill : " +this.price + " Taka\n"; 61 | System.out.println( Bill); 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Burger Bill Project/src/Burger/Main.java: -------------------------------------------------------------------------------- 1 | package Burger; 2 | import DeluxBurger.DeluxBurger; 3 | public class Main { 4 | public static void main(String[] args) { 5 | 6 | DeluxBurger DB = new DeluxBurger(false); // Boolean //True = 500 taka ~~ false = 400 Taka 7 | DB.getTeaPrice(); 8 | DB.getBill(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Burger Bill Project/src/DeluxBurger/DeluxBurger.java: -------------------------------------------------------------------------------- 1 | package DeluxBurger; 2 | import Burger.Burger; 3 | public class DeluxBurger extends Burger{ 4 | 5 | public DeluxBurger(Boolean Bur) { 6 | super(Bur); 7 | super.addExtraCheese(); 8 | super.getWaterPrice(); 9 | } 10 | 11 | @Override 12 | public void getWaterPrice() { 13 | super.getWaterPrice(); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody 14 | } 15 | 16 | @Override 17 | public void addExtraCheese() { 18 | super.addExtraCheese(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test.java: -------------------------------------------------------------------------------- 1 | package E_Output; 2 | public class Test 3 | { 4 | public static void main(String[] args) 5 | { 6 | try 7 | { 8 | System.out.printf(" 1 "); 9 | int sum = 9 / 0; 10 | System.out.printf(" 2 "); 11 | } 12 | catch(ArithmeticException e) 13 | { 14 | System.out.printf(" 3 "); 15 | } 16 | catch(Exception e) 17 | { 18 | System.out.printf(" 4 "); 19 | } 20 | finally 21 | { 22 | System.out.printf(" 5 "); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test2.java: -------------------------------------------------------------------------------- 1 | package E_Output; 2 | 3 | public class Test2 { 4 | 5 | private void m1() { 6 | m2(); 7 | System.out.printf(" 1 "); 8 | } 9 | 10 | private void m2() { 11 | m3(); 12 | System.out.printf(" 2 "); 13 | } 14 | 15 | private void m3() { 16 | System.out.printf(" 3 "); 17 | try { 18 | int sum = 4 / 0; 19 | System.out.printf(" 4 "); 20 | } catch (ArithmeticException e) { 21 | System.out.printf(" 5 "); 22 | } 23 | 24 | System.out.printf(" 7 "); 25 | } 26 | 27 | public static void main(String[] args) { 28 | Test2 obj = new Test2(); 29 | obj.m1(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test3.java: -------------------------------------------------------------------------------- 1 | package E_Output; 2 | public class Test3 3 | { 4 | public static void main(String[] args){ 5 | 6 | try 7 | { 8 | System.out.printf(" 1 "); 9 | int data = 5 / 0; //Error 10 | } 11 | 12 | catch(ArithmeticException e) 13 | { 14 | System.out.printf(" 2 "); 15 | } 16 | finally 17 | { 18 | System.out.printf(" 3 "); 19 | } 20 | System.out.printf(" 4 "); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test4.java: -------------------------------------------------------------------------------- 1 | package E_Output; 2 | public class Test4 3 | { 4 | public static void main(String[] args) 5 | { 6 | try 7 | { 8 | System.out.printf("1"); 9 | int data = 5 / 0; 10 | } 11 | catch(ArithmeticException e) 12 | { 13 | System.out.printf(" 2 "); 14 | System.exit(0); // System is end Here 15 | } 16 | finally 17 | { 18 | System.out.printf(" 3 "); 19 | } 20 | System.out.printf(" 4 "); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test5.java: -------------------------------------------------------------------------------- 1 | 2 | package E_Output; 3 | public class Test5 4 | { 5 | public static void main(String[] args) 6 | { 7 | try 8 | { 9 | System.out.printf(" 1 "); 10 | int data = 5 / 0; 11 | } 12 | catch(NullPointerException e) 13 | { 14 | System.out.printf(" 2 "); 15 | } 16 | finally{ 17 | System.out.printf(" 3 "); 18 | } 19 | 20 | System.out.printf(" 4 "); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test6.java: -------------------------------------------------------------------------------- 1 | package E_Output; 2 | 3 | /* 4 | //import java.io.FileNotFoundException; 5 | 6 | public class Test6{ 7 | public static void main(String[] args) { 8 | 9 | try { 10 | int data = 5 / 0; 11 | } 12 | 13 | catch(FileNotFoundException ex){ 14 | System.out.printf(" 1 "); 15 | } 16 | 17 | catch (Exception ex) { 18 | System.out.printf("2"); 19 | } 20 | catch (ArithmeticException ex){ 21 | System.out.printf(" 3 "); 22 | } 23 | 24 | } 25 | } 26 | */ -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test7.java: -------------------------------------------------------------------------------- 1 | 2 | package E_Output; 3 | public class Test7{ 4 | public static void main(String args[]) { 5 | 6 | try { 7 | int d = 1; 8 | int n = 20; 9 | int fraction = n / d; 10 | int g[] = { 1 }; // Error Found 11 | g[20] = 100; 12 | } 13 | 14 | catch (ArithmeticException e) { 15 | System.out.println("ArithmeticException "); 16 | } 17 | 18 | catch (ArrayIndexOutOfBoundsException e) { 19 | System.out.println("ArrayIndexOutOfBounds"); 20 | } 21 | 22 | System.out.println("End Of Main"); 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /Error_Handalling/src/E_Output/Test8.java: -------------------------------------------------------------------------------- 1 | package E_Output; 2 | public class Test8 { 3 | public static void main(String args[]) { 4 | 5 | try { 6 | int d = 0; 7 | int n = 20; 8 | int fraction = n / d; // Error 9 | int g[] = { 1 }; 10 | g[20] = 100; 11 | } 12 | 13 | catch (ArithmeticException e) { // This section 14 | System.out.println("ArithmeticException "); 15 | } 16 | 17 | catch (ArrayIndexOutOfBoundsException e) { 18 | System.out.println("ArrayIndexOutOfBounds"); 19 | } 20 | 21 | System.out.println("End Of Main"); 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Error_Handalling/src/ExamQuestion/Question.java: -------------------------------------------------------------------------------- 1 | package ExamQuestion; 2 | 3 | public class Question { 4 | 5 | public static void main(String[] args) { 6 | 7 | try { 8 | badMethod(); 9 | System.out.println(" A "); 10 | } 11 | catch (RuntimeException ex) { 12 | System.out.println(" B "); 13 | } 14 | 15 | catch (Exception ex1) { 16 | System.out.println(" C "); 17 | } 18 | 19 | finally { 20 | System.out.println(" D "); 21 | } 22 | System.out.println(" E "); 23 | } 24 | 25 | public static void badMethod() { 26 | throw new RuntimeException(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /If Else/src/If_Else/IfElse.java: -------------------------------------------------------------------------------- 1 | package If_Else; 2 | 3 | import java.util.Scanner; 4 | 5 | public class IfElse { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner input = new Scanner(System.in); 10 | System.out.print("Enter Value (10 / 20 / other ) : "); 11 | int value = input.nextInt(); 12 | 13 | if (value == 10) { 14 | System.out.println("Print value =" + value); // Conditional Method 15 | } 16 | else if (value == 20) { 17 | System.out.println("Print Value =" + value); // Conditional Method 18 | } else { 19 | System.out.println("You are input another Value = "+value); // UnConditional else Method 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Interface Method/src/Interface/Bank.java: -------------------------------------------------------------------------------- 1 | 2 | package Interface; 3 | 4 | public interface Bank { 5 | double Account(); 6 | } 7 | -------------------------------------------------------------------------------- /Interface Method/src/Interface/DBBL.java: -------------------------------------------------------------------------------- 1 | 2 | package Interface; 3 | 4 | public class DBBL implements Bank { 5 | 6 | public double Account(){ 7 | System.out.println("Account system in DBBL Bank"); 8 | return 0; 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Interface Method/src/Interface/IslamiBank.java: -------------------------------------------------------------------------------- 1 | 2 | package Interface; 3 | 4 | public class IslamiBank implements Bank { 5 | public double Account(){ 6 | System.out.println("Account system is Islami Bank "); 7 | return 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Interface Method/src/Interface/TestInterface.java: -------------------------------------------------------------------------------- 1 | 2 | package Interface; 3 | 4 | public class TestInterface { 5 | public static void main(String[] args) { 6 | DBBL d1 = new DBBL(); 7 | d1.Account(); 8 | IslamiBank i1 = new IslamiBank(); 9 | i1.Account(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Interface Method/src/MultipleInterface/DemoClass.java: -------------------------------------------------------------------------------- 1 | 2 | package MultipleInterface; 3 | 4 | public class DemoClass implements FirstIF,SecondIF { 5 | @Override 6 | public void MyMethod(){ 7 | System.out.println(" This is First Interface Method "); 8 | } 9 | @Override 10 | public void otherMethod(){ 11 | System.out.println(" This is second Interface Method "); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Interface Method/src/MultipleInterface/FirstIF.java: -------------------------------------------------------------------------------- 1 | package MultipleInterface; 2 | 3 | public interface FirstIF { 4 | public void MyMethod(); 5 | } 6 | -------------------------------------------------------------------------------- /Interface Method/src/MultipleInterface/Main.java: -------------------------------------------------------------------------------- 1 | 2 | package MultipleInterface; 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | DemoClass d1 = new DemoClass(); 7 | d1.MyMethod(); 8 | d1.otherMethod(); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Interface Method/src/MultipleInterface/SecondIF.java: -------------------------------------------------------------------------------- 1 | package MultipleInterface; 2 | public interface SecondIF { 3 | public void otherMethod(); 4 | 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Multithreating Method/src/A.java: -------------------------------------------------------------------------------- 1 | 2 | public class A implements Runnable { 3 | 4 | @Override 5 | public void run() { 6 | for (int i = 0; i < 10; i++) { 7 | System.out.println(i); 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Multithreating Method/src/B.java: -------------------------------------------------------------------------------- 1 | public class B { 2 | public static void main(String[] args) { 3 | 4 | A obj = new A(); 5 | 6 | Thread T = new Thread(obj); 7 | T.start(); 8 | 9 | for (int i = 0; i < 10; i++) { 10 | System.out.println(i); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Multithreating Method/src/Implements/RunnableDemo.java: -------------------------------------------------------------------------------- 1 | package Implements; 2 | class RunnableDemo implements Runnable { 3 | private Thread t; 4 | private String threadName; 5 | 6 | RunnableDemo( String name) { 7 | threadName = name; 8 | System.out.println("Creating " + threadName ); 9 | } 10 | 11 | // Thread 12 | public void run() { 13 | System.out.println("Running " + threadName ); 14 | try { 15 | for(int i = 4; i > 0; i--) { 16 | System.out.println("Thread: " + threadName + ", " + i); 17 | // Let the thread sleep for a while. 18 | Thread.sleep(50); 19 | } 20 | } 21 | catch (Exception e) 22 | { 23 | System.out.println("Thread " + threadName + " interrupted."); 24 | } 25 | System.out.println("Thread " + threadName + " exiting."); 26 | } 27 | 28 | 29 | // Thread 30 | public void start () 31 | { 32 | System.out.println("Starting " + threadName ); 33 | if (t == null) { 34 | t = new Thread (this, threadName); 35 | t.start (); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Multithreating Method/src/Main.java: -------------------------------------------------------------------------------- 1 | class MyThread extends Thread { 2 | @Override 3 | public void run() { 4 | for (int i = 1; i <= 5; i++) { 5 | System.out.println("Thread " + i); //Thread.currentThread().getId() + ": " 6 | } 7 | } 8 | } 9 | 10 | public class Main { 11 | public static void main(String[] args) { 12 | MyThread thread1 = new MyThread(); 13 | MyThread thread2 = new MyThread(); 14 | 15 | thread1.start(); 16 | thread2.start(); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Multithreating Method/src/RunnableThread/A.java: -------------------------------------------------------------------------------- 1 | package RunnableThread; 2 | 3 | public class A implements Runnable { 4 | 5 | @Override 6 | public void run() { 7 | try{ 8 | for (int i = 0; i < 5; i++) { 9 | System.out.println("A class Runnable Thread "+i); 10 | } 11 | System.out.println(""); 12 | } 13 | catch(Exception e){ 14 | System.out.println(e); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Multithreating Method/src/RunnableThread/B.java: -------------------------------------------------------------------------------- 1 | package RunnableThread; 2 | 3 | public class B { 4 | public static void main(String[] args) { 5 | 6 | A r = new A(); 7 | 8 | Thread t = new Thread(r); 9 | 10 | t.start(); 11 | 12 | for (int i = 0; i < 5; i++) { 13 | System.out.println("B Class Thread "+i); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Multithreating Method/src/Super/Bike.java: -------------------------------------------------------------------------------- 1 | 2 | package Super; 3 | 4 | 5 | public class Bike extends Veichle { 6 | int speed=100; 7 | void display(){ 8 | System.out.println(super.speed); 9 | } 10 | public static void main(String[] args) { 11 | Bike b =new Bike(); 12 | b.display(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Multithreating Method/src/Super/Veichle.java: -------------------------------------------------------------------------------- 1 | 2 | package Super; 3 | 4 | 5 | public class Veichle { 6 | int speed =50; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Multithreating Method/src/Super/speed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template 4 | */ 5 | package Super; 6 | 7 | /** 8 | * 9 | * @author Sajjad Jim 10 | */ 11 | class speed { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Multithreating Method/src/Thread_Extends/A.java: -------------------------------------------------------------------------------- 1 | package Thread_Extends; 2 | public class A extends Thread { 3 | 4 | @Override 5 | public void run() { 6 | try { 7 | for (int i = 1; i <= 5; i++) { 8 | System.out.println("A class Thread is running " + i); 9 | } 10 | } catch (Exception e) { 11 | System.out.println("Found the exception " + e); 12 | } 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Multithreating Method/src/Thread_Extends/B.java: -------------------------------------------------------------------------------- 1 | package Thread_Extends; 2 | 3 | public class B { 4 | 5 | public static void main(String[] args) { 6 | A thr = new A(); 7 | 8 | // Thread t = new Thread(thr); 9 | // t.start(); 10 | 11 | thr.start(); 12 | 13 | try { 14 | for (int i = 1; i <= 5; i++) { 15 | System.out.println("B class Thread is running " + i); 16 | } 17 | } catch (Exception e) { 18 | System.out.println(e); 19 | } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Multithreating Method/src/multithreating/Multithread.java: -------------------------------------------------------------------------------- 1 | package multithreating; 2 | 3 | // Main Class 4 | public class Multithread { 5 | public static void main(String[] args) 6 | { 7 | MultithreadingDemo object = new MultithreadingDemo(); 8 | object.start(); 9 | 10 | int n = 4; // Number of threads 11 | for (int i = 0; i < n; i++) { 12 | System.out.println(i); 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Multithreating Method/src/multithreating/MultithreadingDemo.java: -------------------------------------------------------------------------------- 1 | package multithreating; 2 | 3 | class MultithreadingDemo extends Thread { 4 | 5 | public void run() { 6 | try { 7 | // Displaying the thread that is running 8 | for (int i = 0; i < 5; i++) { 9 | 10 | System.out.println("Thread " + i + " is running"); 11 | } 12 | } catch (Exception e) { 13 | // Throwing an exception 14 | System.out.println("Exception is caught"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project OOP Project. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Animal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Animal.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Bird.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Bird.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Crocodile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Crocodile.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Habits.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Habits.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Home.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Home.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Human.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Human.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Take_Input/getValue.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Take_Input/getValue.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/Take_Input/infoList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/Take_Input/infoList.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/build/classes/TestClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Object Oriented Programming BASIC Project/build/classes/TestClass.class -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=5828cb28 2 | build.xml.script.CRC32=f5953e30 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.106.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=5828cb28 7 | nbproject/build-impl.xml.script.CRC32=1866f779 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.106.0.48 9 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\habib\\AppData\\Roaming\\NetBeans\\17\\build.properties 3 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Bird.java 7 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Crocodile.java 8 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Human.java 9 | file:/D:/OOP/OOP-Project/OOP%20Project/src/TestClass.java 10 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Habits.java 11 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Take_Input/getValue.java 12 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Animal.java 13 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Home.java 14 | file:/D:/OOP/OOP-Project/OOP%20Project/src/Take_Input/infoList.java 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.modulepath=\ 22 | ${run.modulepath} 23 | debug.test.classpath=\ 24 | ${run.test.classpath} 25 | debug.test.modulepath=\ 26 | ${run.test.modulepath} 27 | # Files in build.classes.dir which should be excluded from distribution jar 28 | dist.archive.excludes= 29 | # This directory is removed when the project is cleaned: 30 | dist.dir=dist 31 | dist.jar=${dist.dir}/OOP_Project.jar 32 | dist.javadoc.dir=${dist.dir}/javadoc 33 | dist.jlink.dir=${dist.dir}/jlink 34 | dist.jlink.output=${dist.jlink.dir}/OOP_Project 35 | excludes= 36 | includes=** 37 | jar.compress=false 38 | javac.classpath= 39 | # Space-separated list of extra javac options 40 | javac.compilerargs= 41 | javac.deprecation=false 42 | javac.external.vm=true 43 | javac.modulepath= 44 | javac.processormodulepath= 45 | javac.processorpath=\ 46 | ${javac.classpath} 47 | javac.source=19 48 | javac.target=19 49 | javac.test.classpath=\ 50 | ${javac.classpath}:\ 51 | ${build.classes.dir} 52 | javac.test.modulepath=\ 53 | ${javac.modulepath} 54 | javac.test.processorpath=\ 55 | ${javac.test.classpath} 56 | javadoc.additionalparam= 57 | javadoc.author=false 58 | javadoc.encoding=${source.encoding} 59 | javadoc.html5=false 60 | javadoc.noindex=false 61 | javadoc.nonavbar=false 62 | javadoc.notree=false 63 | javadoc.private=false 64 | javadoc.splitindex=true 65 | javadoc.use=true 66 | javadoc.version=false 67 | javadoc.windowtitle= 68 | # The jlink additional root modules to resolve 69 | jlink.additionalmodules= 70 | # The jlink additional command line parameters 71 | jlink.additionalparam= 72 | jlink.launcher=true 73 | jlink.launcher.name=OOP_Project 74 | main.class=labfibalexam.LabFibalExam 75 | manifest.file=manifest.mf 76 | meta.inf.dir=${src.dir}/META-INF 77 | mkdist.disabled=false 78 | platform.active=default_platform 79 | run.classpath=\ 80 | ${javac.classpath}:\ 81 | ${build.classes.dir} 82 | # Space-separated list of JVM arguments used when running the project. 83 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 84 | # To set system properties for unit tests define test-sys-prop.name=value: 85 | run.jvmargs= 86 | run.modulepath=\ 87 | ${javac.modulepath} 88 | run.test.classpath=\ 89 | ${javac.test.classpath}:\ 90 | ${build.test.classes.dir} 91 | run.test.modulepath=\ 92 | ${javac.test.modulepath} 93 | source.encoding=UTF-8 94 | src.dir=src 95 | test.src.dir=test 96 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | OOP Project 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Animal.java: -------------------------------------------------------------------------------- 1 | 2 | public abstract class Animal { 3 | 4 | String kingdom; 5 | 6 | public Animal(String kingdom) { 7 | this.kingdom = kingdom; 8 | } 9 | public abstract void display(); 10 | } -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Bird.java: -------------------------------------------------------------------------------- 1 | public class Bird extends Animal implements Habits { 2 | 3 | String name; 4 | 5 | public Bird(String kingdom, String name) { 6 | super(kingdom); 7 | this.name = name; 8 | } 9 | 10 | @Override 11 | public void display() { 12 | System.out.println("Kingdom of Bird = " + this.kingdom); 13 | System.out.println("Bird Name : " + this.name); 14 | 15 | Home H = new Home("World"); 16 | H.display(); 17 | 18 | running(); 19 | eating(); 20 | } 21 | 22 | @Override 23 | public void running() { 24 | System.out.println("Birds can Fly."); 25 | } 26 | 27 | @Override 28 | public void eating() { 29 | System.out.println("Birds are eat insects."); 30 | } 31 | 32 | } 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Crocodile.java: -------------------------------------------------------------------------------- 1 | public class Crocodile extends Animal implements Habits { 2 | int age; 3 | String size; 4 | public Crocodile(String kingdom, int age, String size) { 5 | super(kingdom); 6 | this.age = age; 7 | this.size = size; 8 | } 9 | 10 | @Override 11 | public void display() { 12 | System.out.println("Kingdom of = " + this.kingdom); 13 | System.out.println("Crocodile age : " + this.age); 14 | System.out.println("Crocodile Size : " + this.size); 15 | 16 | Home H = new Home("World"); 17 | H.display(); 18 | 19 | running(); 20 | eating(); 21 | } 22 | 23 | @Override 24 | public void running() { 25 | System.out.println("Crocodile are stay in water."); 26 | } 27 | 28 | @Override 29 | public void eating() { 30 | System.out.println("Crocodiles are eat fish and meat."); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Habits.java: -------------------------------------------------------------------------------- 1 | public interface Habits { 2 | public abstract void running(); 3 | public abstract void eating(); 4 | } 5 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Home.java: -------------------------------------------------------------------------------- 1 | public class Home { 2 | String placeOfStay; 3 | 4 | public Home(String placeOfStay) { 5 | this.placeOfStay = placeOfStay; 6 | } 7 | public void display(){ 8 | System.out.println("Stay in "+this.placeOfStay+" universe..."); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Human.java: -------------------------------------------------------------------------------- 1 | public class Human extends Animal implements Habits { 2 | int age; 3 | String weight; 4 | 5 | public Human(String kingdom, int age, String size) { 6 | super(kingdom); 7 | this.age = age; 8 | this.weight = size; 9 | } 10 | 11 | @Override 12 | public void display() { 13 | System.out.println("Kingdom of Human = " + this.kingdom); 14 | System.out.println("Human age : " + this.age ); 15 | System.out.println("Human weight : " + this.weight); 16 | 17 | Home H = new Home("World"); 18 | H.display(); 19 | 20 | running(); 21 | eating(); 22 | } 23 | 24 | @Override 25 | public void running() { 26 | System.out.println("Human can run fast ."); 27 | } 28 | 29 | @Override 30 | public void eating() { 31 | System.out.println("All Human are eat halal food."); 32 | } 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Take_Input/getValue.java: -------------------------------------------------------------------------------- 1 | package Take_Input; 2 | 3 | public class getValue { 4 | private String name; 5 | private int age; 6 | 7 | public getValue(String name, int age) { 8 | this.name = name; 9 | this.age = age; 10 | } 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public int getAge() { 17 | return age; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/Take_Input/infoList.java: -------------------------------------------------------------------------------- 1 | package Take_Input; 2 | import java.util.ArrayList; 3 | import java.util.Scanner; 4 | 5 | public class infoList extends getValue { 6 | 7 | public infoList(String name, int age) { 8 | super(name, age); 9 | } 10 | 11 | public void information() { 12 | ArrayList arList = new ArrayList<>(); 13 | Scanner input = new Scanner(System.in); 14 | 15 | System.out.print("Enter number of N : "); 16 | int N = input.nextInt(); 17 | 18 | 19 | 20 | for (int i = 0; i < N; i++) { 21 | System.out.print("Enter name : "); 22 | String infoName = input.next(); 23 | 24 | System.out.print("Enter age : "); 25 | int infoAge = input.nextInt(); 26 | 27 | arList.add(new infoList(infoName, infoAge)); 28 | System.out.println(); 29 | } 30 | // Display Information 31 | 32 | for (int i = 0; i < arList.size(); i++) { 33 | arList.get(i).display(); 34 | } 35 | } 36 | 37 | public void display() { 38 | System.out.println("Name :" +this.getName()); 39 | System.out.println("Age :" +this.getAge()); 40 | System.out.println(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Object Oriented Programming BASIC Project/src/TestClass.java: -------------------------------------------------------------------------------- 1 | import Take_Input.infoList; 2 | public class TestClass { 3 | 4 | public static void main(String[] args) { 5 | 6 | System.out.println("***WelCome to OOP Project***\n\n"); 7 | 8 | infoList info = new infoList("Habib ",23); 9 | //ArryList Input From User 10 | info.information(); 11 | info.display(); 12 | 13 | System.out.println("~~~ Crocodile Information ~~~"); 14 | // Display Crocodile Information 15 | Crocodile D = new Crocodile("Crocodylidae",17,"12 Feet"); 16 | D.display(); 17 | 18 | // Human INformation 19 | System.out.println("\n~~ Human Information ~~\n"); 20 | Human H = new Human("Homo sapiens",23,"67 KG"); 21 | H.display(); 22 | 23 | //Bird Information 24 | System.out.println("\n** Bird Information **\n"); 25 | Bird B = new Bird("Aves","Haming-Bird"); 26 | B.display(); 27 | 28 | System.out.println("\n"); 29 | 30 | // Exception Handalling 31 | int x=10; 32 | int y= 0; 33 | 34 | try{ 35 | int num = x/y ; 36 | System.out.println(num); 37 | 38 | } 39 | catch(Exception e){ 40 | System.out.println(e); 41 | } 42 | 43 | 44 | //Method OverLoading 45 | TestClass obj=new TestClass(); 46 | obj.sum(10.5,10.5); 47 | obj.sum(20,10); 48 | System.out.println(); 49 | } 50 | 51 | void sum(int a,int b) 52 | { 53 | System.out.println(a+b); 54 | } 55 | void sum(double a, double b) 56 | { 57 | System.out.println(a+b); 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Pattern Java Code/src/pattern1/pattern1.java: -------------------------------------------------------------------------------- 1 | package pattern1; 2 | import java.util.Scanner; 3 | public class pattern1 { 4 | public static void main(String[] args) { 5 | Scanner input = new Scanner(System.in); 6 | int row, column ,n ; 7 | 8 | System.out.print("Enter the value of n ="); 9 | n = input.nextInt(); 10 | 11 | for ( row = 0; row < n; row++) 12 | { 13 | for(column = 0; column < row ; column ++) 14 | { 15 | System.out.print(" "+(column+1)); 16 | } 17 | System.out.println(); 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Pattern Java Code/src/pattern1/pattern2.java: -------------------------------------------------------------------------------- 1 | package pattern1; 2 | import java.util.Scanner; 3 | public class pattern2 { 4 | public static void main(String[] args) { 5 | Scanner input = new Scanner(System.in); 6 | int row, column ,n ; 7 | 8 | System.out.print("Enter the value of n ="); 9 | n = input.nextInt(); 10 | 11 | for ( row = n; row >= 1; row--) 12 | { 13 | for(column = 1; column <=row ; column ++) 14 | { 15 | System.out.print(" * "); 16 | } 17 | System.out.println(); 18 | } 19 | 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Pattern Java Code/src/pattern1/pattern3.java: -------------------------------------------------------------------------------- 1 | 2 | package pattern1; 3 | 4 | import java.util.Scanner; 5 | 6 | public class pattern3 { 7 | 8 | public static void main(String[] args) { 9 | Scanner input = new Scanner(System.in); 10 | int row, column ,n ; 11 | 12 | System.out.print("Enter the value of n ="); 13 | n = input.nextInt(); 14 | 15 | for ( row = 0; row < n; row++) 16 | { 17 | for(column = 0; column < row ; column ++) 18 | { 19 | System.out.print(" "+row); 20 | } 21 | System.out.println(); 22 | } 23 | 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Pattern Java Code/src/pattern1/pattern4.java: -------------------------------------------------------------------------------- 1 | package pattern1; 2 | 3 | import java.util.Scanner; 4 | 5 | public class pattern4 { 6 | public static void main(String[] args) { 7 | Scanner input = new Scanner(System.in); 8 | int row , column,n; 9 | System.out.print("Enter How many Pattern You want :"); 10 | n = input.nextInt(); 11 | 12 | //Forward 13 | for ( row = 0; row < n; row++) { 14 | for ( column = 0; column < row; column++) 15 | { 16 | System.out.print(" * "); 17 | } 18 | System.out.println(); 19 | } 20 | 21 | // Reverse 22 | for ( row = n-2; row > 0; row--) { 23 | for ( column = 0; column < row; column++) { 24 | System.out.print(" * "); 25 | } 26 | System.out.println(); 27 | } 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Practice Question Problem/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Practice. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Final_Exam_Practice/Ball.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Final_Exam_Practice/Ball.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Final_Exam_Practice/Baseball.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Final_Exam_Practice/Baseball.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Final_Exam_Practice/Football.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Final_Exam_Practice/Football.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Final_Exam_Practice/MainClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Final_Exam_Practice/MainClass.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Final_Exam_Practice/Rock.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Final_Exam_Practice/Rock.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Final_Exam_Practice/Tossable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Final_Exam_Practice/Tossable.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/Animal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/Animal.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/Cat.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/Cat.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/Dog.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/Dog.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/Exception28.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/Exception28.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/ExceptionPropagationExample.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/ExceptionPropagationExample.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/Main.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/Problem27/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/Problem27/Test.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/practice/DefaultConstractor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/practice/DefaultConstractor.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/practice/MethodOverloading.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/practice/MethodOverloading.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/practice/Search.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/practice/Search.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/problem/Department.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/problem/Department.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/problem/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/problem/Person.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/problem/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/problem/Student.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/problem/Teacher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/problem/Teacher.class -------------------------------------------------------------------------------- /Practice Question Problem/build/classes/problem/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/Java_Programming_Language/8f5008744c7b39b987fb1ed7485d1256609816aa/Practice Question Problem/build/classes/problem/Test.class -------------------------------------------------------------------------------- /Practice Question Problem/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Practice Question Problem/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=55016137 2 | build.xml.script.CRC32=78e5eb12 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=55016137 7 | nbproject/build-impl.xml.script.CRC32=5172b26a 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48 9 | -------------------------------------------------------------------------------- /Practice Question Problem/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\Sajjad Jim\\AppData\\Roaming\\NetBeans\\17\\build.properties 3 | -------------------------------------------------------------------------------- /Practice Question Problem/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Practice Question Problem/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.modulepath=\ 22 | ${run.modulepath} 23 | debug.test.classpath=\ 24 | ${run.test.classpath} 25 | debug.test.modulepath=\ 26 | ${run.test.modulepath} 27 | # Files in build.classes.dir which should be excluded from distribution jar 28 | dist.archive.excludes= 29 | # This directory is removed when the project is cleaned: 30 | dist.dir=dist 31 | dist.jar=${dist.dir}/Practice.jar 32 | dist.javadoc.dir=${dist.dir}/javadoc 33 | dist.jlink.dir=${dist.dir}/jlink 34 | dist.jlink.output=${dist.jlink.dir}/Practice 35 | excludes= 36 | includes=** 37 | jar.compress=false 38 | javac.classpath= 39 | # Space-separated list of extra javac options 40 | javac.compilerargs= 41 | javac.deprecation=false 42 | javac.external.vm=true 43 | javac.modulepath= 44 | javac.processormodulepath= 45 | javac.processorpath=\ 46 | ${javac.classpath} 47 | javac.source=19 48 | javac.target=19 49 | javac.test.classpath=\ 50 | ${javac.classpath}:\ 51 | ${build.classes.dir} 52 | javac.test.modulepath=\ 53 | ${javac.modulepath} 54 | javac.test.processorpath=\ 55 | ${javac.test.classpath} 56 | javadoc.additionalparam= 57 | javadoc.author=false 58 | javadoc.encoding=${source.encoding} 59 | javadoc.html5=false 60 | javadoc.noindex=false 61 | javadoc.nonavbar=false 62 | javadoc.notree=false 63 | javadoc.private=false 64 | javadoc.splitindex=true 65 | javadoc.use=true 66 | javadoc.version=false 67 | javadoc.windowtitle= 68 | # The jlink additional root modules to resolve 69 | jlink.additionalmodules= 70 | # The jlink additional command line parameters 71 | jlink.additionalparam= 72 | jlink.launcher=true 73 | jlink.launcher.name=Practice 74 | main.class=practice.Practice 75 | manifest.file=manifest.mf 76 | meta.inf.dir=${src.dir}/META-INF 77 | mkdist.disabled=false 78 | platform.active=default_platform 79 | run.classpath=\ 80 | ${javac.classpath}:\ 81 | ${build.classes.dir} 82 | # Space-separated list of JVM arguments used when running the project. 83 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 84 | # To set system properties for unit tests define test-sys-prop.name=value: 85 | run.jvmargs= 86 | run.modulepath=\ 87 | ${javac.modulepath} 88 | run.test.classpath=\ 89 | ${javac.test.classpath}:\ 90 | ${build.test.classes.dir} 91 | run.test.modulepath=\ 92 | ${javac.test.modulepath} 93 | source.encoding=UTF-8 94 | src.dir=src 95 | test.src.dir=test 96 | -------------------------------------------------------------------------------- /Practice Question Problem/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Practice 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Final_Exam_Practice/Ball.java: -------------------------------------------------------------------------------- 1 | package Final_Exam_Practice; 2 | public abstract class Ball implements Tossable { 3 | private String brandName; 4 | 5 | public Ball(String brandName) { 6 | this.brandName = brandName; 7 | } 8 | 9 | public String getBrandName() { 10 | return brandName; 11 | } 12 | 13 | public abstract void bounce(); 14 | 15 | @Override 16 | public void toss() { 17 | System.out.println("First Toss then play with Ball......."); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Final_Exam_Practice/Baseball.java: -------------------------------------------------------------------------------- 1 | package Final_Exam_Practice; 2 | 3 | public class Baseball extends Ball { 4 | 5 | public Baseball(String brandName) { 6 | super(brandName); 7 | } 8 | 9 | @Override 10 | public void toss(){ 11 | System.out.println("Play start Before Toss........"); 12 | } 13 | @Override 14 | public void bounce(){ 15 | toss(); 16 | System.out.println(getBrandName()+" is not bounce"); 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Final_Exam_Practice/Football.java: -------------------------------------------------------------------------------- 1 | package Final_Exam_Practice; 2 | 3 | public class Football extends Ball { 4 | 5 | public Football(String brandName) { 6 | super(brandName); 7 | } 8 | 9 | @Override 10 | public void bounce() { 11 | toss(); 12 | System.out.println(super.getBrandName()+" is bounce......."); 13 | } 14 | @Override 15 | public void toss(){ 16 | System.out.println("Play before toss........."); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Final_Exam_Practice/MainClass.java: -------------------------------------------------------------------------------- 1 | package Final_Exam_Practice; 2 | 3 | public class MainClass { 4 | public static void main(String[] args) { 5 | Baseball B = new Baseball("Base Ball"); 6 | B.bounce(); 7 | 8 | System.out.println("\n"); 9 | 10 | Football F = new Football("FootBall "); 11 | F.bounce(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Final_Exam_Practice/Rock.java: -------------------------------------------------------------------------------- 1 | package Final_Exam_Practice; 2 | public class Rock implements Tossable { 3 | 4 | @Override 5 | public void toss() { 6 | System.out.println(" Head / Tell what You want ??"); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Final_Exam_Practice/Tossable.java: -------------------------------------------------------------------------------- 1 | package Final_Exam_Practice; 2 | public interface Tossable { 3 | public abstract void toss(); 4 | } 5 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Problem27/Animal.java: -------------------------------------------------------------------------------- 1 | package Problem27; 2 | 3 | public class Animal { 4 | 5 | public void makeSound() { 6 | System.out.println("Animal is making a sound"); 7 | 8 | } 9 | } 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Problem27/Cat.java: -------------------------------------------------------------------------------- 1 | 2 | package Problem27; 3 | 4 | class Cat extends Animal { 5 | 6 | public void makeSound() { 7 | System.out.println("Cat is meowing"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Problem27/Dog.java: -------------------------------------------------------------------------------- 1 | package Problem27; 2 | 3 | class Dog extends Animal { 4 | @Override 5 | public void makeSound() { 6 | System.out.println("Dog is barking"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Problem27/ExceptionPropagationExample.java: -------------------------------------------------------------------------------- 1 | package Problem27; 2 | public class ExceptionPropagationExample { 3 | 4 | public static void main(String[] args) { 5 | try { 6 | method1(); 7 | 8 | } 9 | catch (Exception e) { 10 | System.out.println("Exception caught in main: " + e.getMessage()); // Never Print 11 | } 12 | } 13 | 14 | public static void method1() { 15 | try { 16 | method2(); 17 | } 18 | 19 | catch (Exception e) { 20 | System.out.println("Exception caught in method1: " + e.getMessage()); 21 | throw e; 22 | } 23 | } 24 | 25 | public static void method2() { 26 | try { 27 | int result = divide(10, 0); 28 | 29 | System.out.println("Result: " + result); 30 | } 31 | 32 | catch (ArithmeticException e) { 33 | System.out.println("Exception caught in method2: " + e.getMessage()); // print 34 | 35 | throw new RuntimeException("Custom exception message"); 36 | } 37 | } 38 | 39 | public static int divide(int numerator, int denominator) { 40 | 41 | return numerator / denominator; 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Problem27/Main.java: -------------------------------------------------------------------------------- 1 | package Problem27; 2 | 3 | public class Main { 4 | 5 | public static void main(String[] args) { 6 | 7 | Dog animal1 = new Dog(); // Polymorphism - Dog object treated as Animal 8 | 9 | Cat animal2 = new Cat(); // Polymorphism - Cat object treated as Animal 10 | 11 | animal1.makeSound(); // Calls the overridden method in Dog class 12 | 13 | animal2.makeSound(); // Calls the overridden method in Cat class 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Practice Question Problem/src/Problem27/Test.java: -------------------------------------------------------------------------------- 1 | package Problem27; 2 | public class Test { 3 | 4 | private void m1() { 5 | m2(); 6 | System.out.printf(" 1 "); // never 7 | } 8 | 9 | private void m2() { 10 | m3(); 11 | System.out.printf(" 2 "); 12 | } 13 | 14 | private void m3() { 15 | 16 | System.out.printf( " 3 "); // 17 | 18 | try { 19 | int sum = 4 / 0; 20 | System.out.printf("4"); 21 | } 22 | 23 | catch (ArithmeticException e) { 24 | 25 | System.out.printf(" 5 "); 26 | } 27 | System.out.printf(" 7 "); 28 | } 29 | 30 | 31 | public static void main(String[] args) { 32 | Test obj = new Test(); 33 | obj.m1(); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Practice Question Problem/src/practice/DefaultConstractor.java: -------------------------------------------------------------------------------- 1 | package practice; 2 | 3 | public class DefaultConstractor { 4 | String name; 5 | int age; 6 | 7 | DefaultConstractor(){ 8 | name ="SajjadJim"; 9 | age = 25; 10 | } 11 | public void insert(String sname,int sage){ 12 | this.name= sname; 13 | this.age = sage; 14 | } 15 | 16 | public void display(){ 17 | System.out.println("Name :"+this.name); 18 | System.out.println("Age :"+this.age); 19 | } 20 | 21 | public DefaultConstractor(String sname, int sage){ 22 | this.name = sname; 23 | this.age = sage; 24 | 25 | } 26 | public static void main(String[] args) { 27 | DefaultConstractor man1 = new DefaultConstractor(); 28 | DefaultConstractor man2 = new DefaultConstractor(); 29 | DefaultConstractor man3 = new DefaultConstractor("Siam KIng",13); 30 | 31 | man2.insert("Umme Salma", 25); 32 | 33 | man1.display(); 34 | man2.display(); 35 | man3.display(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Practice Question Problem/src/practice/MethodOverloading.java: -------------------------------------------------------------------------------- 1 | package practice; 2 | public class MethodOverloading { 3 | 4 | 5 | void sum(int a, int b) 6 | { 7 | System.out.println(a+b); 8 | } 9 | 10 | void sum(double a,double b){ 11 | 12 | } 13 | 14 | public static void main(String[] args) { 15 | 16 | MethodOverloading obj = new MethodOverloading(); 17 | obj.sum(20,20); 18 | obj.sum(10, 50); 19 | } 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /Practice Question Problem/src/practice/Search.java: -------------------------------------------------------------------------------- 1 | package practice; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Search { 6 | 7 | String name; 8 | /////////////////////////////////////////////////////// 9 | public void insertvalue(String sname) { 10 | this.name = sname; 11 | } 12 | 13 | //////////////////////////////////////////////////////// 14 | public void SearchName(Search[] array, String searchname, int n) { 15 | int i, index = 0; 16 | int flag = 0; 17 | 18 | for (i = 0; i < n; i++) { 19 | 20 | if (array[i].name.equalsIgnoreCase(searchname)) { 21 | flag = 1; 22 | index = i; 23 | } 24 | if (flag == 1) { 25 | System.out.println("Name Found AT " + index + " Index"); 26 | } else if (flag == 0) { 27 | System.out.println("Array Not Fount In Index"); 28 | } 29 | } 30 | } 31 | 32 | ///////////////////// Display Method //////////////////////////////// 33 | void display() { 34 | System.out.println("Name :" + this.name); 35 | } 36 | 37 | // Main Method 38 | public static void main(String[] args) { 39 | Scanner input = new Scanner(System.in); 40 | int n, i; 41 | System.out.print("Enter How many You want :"); 42 | n = input.nextInt(); 43 | Search[] array = new Search[n]; 44 | System.out.println("Enter Number Array"); 45 | for (i = 0; i < n; i++) { 46 | array[i] = new Search(); 47 | System.out.print("Enter Name :"); 48 | String sname = input.next(); 49 | array[i].insertvalue(sname); 50 | } 51 | for (i = 0; i < n; i++) { 52 | array[i].display(); 53 | } 54 | 55 | ////////////////////////////////////////////////////// 56 | System.out.print(" Enter the Name Search :"); 57 | String searchname = input.next(); 58 | Search obj = new Search(); 59 | obj.SearchName(array, searchname, n); 60 | 61 | ////////////////////////////////////////////////////////////// 62 | System.out.print("Enter The Name Number You want :"); 63 | int deleteIndex = input.nextInt(); 64 | array[deleteIndex] = null; 65 | 66 | System.out.println("** After Delete The Name List **"); 67 | for (i = 0; i < n; i++) { 68 | if (array[i] != null) { 69 | array[i].display(); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Practice Question Problem/src/problem/Department.java: -------------------------------------------------------------------------------- 1 | package problem; 2 | 3 | import java.util.Scanner; 4 | public class Department { 5 | String deptName; 6 | int deptCode; 7 | 8 | void Department(String deptName, int deptCode) { 9 | this.deptName = deptName; 10 | this.deptCode = deptCode; 11 | } 12 | public static void main(String[] args) { 13 | 14 | Scanner input = new Scanner(System.in); 15 | 16 | Student s1 = new Student(); 17 | s1.Person("Rifat", 25); 18 | s1.Student("221-15-5364", 3.55); 19 | s1.Display(); 20 | s1.Display(); 21 | Department d1 = new Department(); 22 | d1.Department("Cse", 221); 23 | d1.DisplayAll(); 24 | 25 | System.out.println("\n"); 26 | 27 | Teacher t1 = new Teacher(); 28 | t1.Teacher("Advisor", "CSE"); 29 | t1.Person("Itisha Nowrin ", 37); 30 | t1.Display(); 31 | t1.Display(); 32 | Department d2 = new Department(); 33 | d2.Department("CSE", 333); 34 | d2.DisplayAll(); 35 | 36 | } 37 | 38 | void DisplayAll() { 39 | System.out.println("Department name : " + this.deptName); 40 | System.out.println("Code name : " + this.deptCode); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Practice Question Problem/src/problem/Person.java: -------------------------------------------------------------------------------- 1 | package problem; 2 | 3 | public class Person { 4 | private String name; 5 | private int age; 6 | 7 | public void Person(String name , int age){ 8 | this.name = name; 9 | this.age = age; 10 | } 11 | void Display(){ 12 | System.out.println("Name : "+this.name); 13 | System.out.println("Age : "+this.age); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Practice Question Problem/src/problem/Student.java: -------------------------------------------------------------------------------- 1 | package problem; 2 | 3 | public class Student extends Person { 4 | String id; 5 | double cgpa; 6 | 7 | public void Student(String id , double cgpa){ 8 | 9 | this.cgpa = cgpa; 10 | this.id =id; 11 | } 12 | void Display(){ 13 | System.out.println("ID : "+this.id); 14 | System.out.println("CGPA : "+this.cgpa); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Practice Question Problem/src/problem/Teacher.java: -------------------------------------------------------------------------------- 1 | package problem; 2 | 3 | public class Teacher extends Person { 4 | String deggnation; 5 | String dpt; 6 | 7 | void Teacher(String deggnation, String dpt ){ 8 | this.deggnation = deggnation; 9 | this.dpt = dpt; 10 | } 11 | void Display(){ 12 | 13 | System.out.println("Degination : "+this.deggnation); 14 | System.out.println("DEPT : "+this.dpt); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Practice Question Problem/src/problem/Test.java: -------------------------------------------------------------------------------- 1 | package problem; 2 | 3 | public class Test { 4 | 5 | private void m2() { 6 | m3(); 7 | System.out.printf(" 2"); 8 | 9 | } 10 | 11 | private void m1() { 12 | m2(); 13 | System.out.printf(" 1"); 14 | } 15 | 16 | 17 | 18 | private void m3() { 19 | System.out.printf(" 3"); 20 | try { 21 | int sum = 4 / 0; 22 | System.out.printf(" 4"); 23 | } catch (ArithmeticException e) { 24 | System.out.printf(" 5"); 25 | } 26 | System.out.printf(" 7"); 27 | } 28 | 29 | public static void main(String[] args) { 30 | Test obj = new Test(); 31 | obj.m1(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java_Programming_Language 2 | 3 | Object Oriented Programming (CSE 214) course 4 | 5 | Daffodil International University 6 | -------------------------------------------------------------------------------- /SwitchCase/src/switchcase/Switch.java: -------------------------------------------------------------------------------- 1 | package switchcase; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Switch { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner input = new Scanner(System.in); 10 | int number; 11 | System.out.print("Enter any Digit(0-9)="); 12 | number = input.nextInt(); 13 | 14 | switch (number) { 15 | case 0: 16 | System.out.println("Zero"); 17 | break; 18 | case 1: 19 | System.out.println("One"); 20 | break; 21 | case 2: 22 | System.out.println("Two"); 23 | break; 24 | case 3: 25 | System.out.println("Three"); 26 | break; 27 | 28 | case 4: 29 | System.out.println("Four"); 30 | 31 | break; 32 | case 5: 33 | System.out.println("Five"); 34 | 35 | break; 36 | case 6: 37 | System.out.println("Six"); 38 | 39 | break; 40 | case 7: 41 | System.out.println("Seven"); 42 | 43 | break; 44 | case 8: 45 | System.out.println("Eight"); 46 | 47 | break; 48 | case 9: 49 | System.out.println("Nine"); 50 | break; 51 | 52 | default: 53 | System.out.println("No digit"); 54 | } 55 | 56 | } 57 | } 58 | --------------------------------------------------------------------------------