├── .idea ├── .name ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── kotlinc.xml ├── libraries │ └── KotlinJavaRuntime.xml ├── misc.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── AJFoods-master ├── AJFoods.form ├── AJFoods.java ├── AJMarketing.form ├── AJMarketing.java ├── diet.png ├── homepage.png └── spaguetti.png ├── Aggregation ├── Address.java ├── Aggregation.java └── Students.java ├── BarcodeGenerator.java ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Conditional Structures ├── IfAllConditionsExample.java ├── Ifconditionexample.java ├── IfelseconditionExample.java ├── NestedIfConditionsExample.java ├── NestedSwitch ├── README.md ├── guessingnumbergame.java └── switchExample.java ├── CovarianceReturnType └── SuperClass.java ├── CreatingStrings ├── Data Structures & Algorithm ├── AVL Tree │ └── AVLTree.java ├── Arrays │ ├── Array List │ ├── ArrayBinarySearch.java │ ├── ArrayDelete.java │ ├── ArrayElementEvenOrOdd.java │ ├── ArrayInsert.java │ ├── ArraySizeEvenOrOdd.java │ └── ReverseArray.java ├── Binary Tree │ ├── BinaryTree.java │ ├── LinkedQueue.java │ ├── Queue.java │ ├── Task1.java │ └── Test.java ├── Collection │ ├── AbstractCollection.java │ ├── ArrayCollection.java │ ├── Collection.java │ ├── Iterator.java │ ├── LinkedCollection.java │ └── TestArrayCollection.java ├── Graphs │ ├── 1. Adjancency Matrix │ │ ├── Graph.java │ │ └── Test.java │ └── 2. Adjacency List │ │ ├── Graph.java │ │ └── Test.java ├── HashTables │ ├── 1. Linear Probing │ │ ├── HashTable.java │ │ ├── Map.java │ │ └── Test.java │ ├── 2. Quadratic Probing │ │ ├── HashTable.java │ │ ├── Map.java │ │ └── Test.java │ ├── 3. Double Hashing │ │ ├── HashTable.java │ │ ├── Map.java │ │ └── Test.java │ └── 4. Separate Chaining (Closed Addressing) │ │ ├── HashTable.java │ │ ├── Map.java │ │ └── Test.java ├── Queue │ ├── Implementation using Array │ │ ├── ArrayQueue.java │ │ ├── Queue.java │ │ └── TestQueue.java │ └── Implementation using LinkedList │ │ ├── LinkedQueue.java │ │ ├── Queue.java │ │ └── TestQueue.java ├── RPN (Reverse Polish Notation) │ ├── ArrayStack.java │ ├── RPN1.java │ └── RPN2.java ├── Recursion │ ├── Recursion.java │ └── Recursion2.java ├── Sorting │ ├── Bitonic Sort.java │ ├── BubbleSort.java │ ├── HeapSort.java │ ├── InsertionSort.java │ ├── MergeSort.java │ ├── QuickSort.java │ ├── Radix.Java │ └── SelectionSort.java └── Stack │ ├── Implementation using Array │ ├── ArrayStack.java │ ├── LinkedStack.java │ ├── Stack.java │ └── TestStack.java │ └── Implementation using LinkedList │ ├── ArrayStack.java │ ├── LinkedStack.java │ ├── Stack.java │ └── TestStack.java ├── DesignPattern ├── .idea │ ├── .gitignore │ ├── misc.xml │ └── modules.xml ├── DesignPattern.iml ├── FactoryPattern │ ├── FactoryPattern.iml │ └── src │ │ ├── FactoryDemo.java │ │ ├── FootBall.java │ │ ├── Rugby.java │ │ ├── Sport.java │ │ ├── SportFactory.java │ │ └── VolleyBall.java ├── MementoPattern │ ├── .idea │ │ ├── .gitignore │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── uiDesigner.xml │ ├── MementoPattern.iml │ └── src │ │ ├── MementoDemo.java │ │ ├── ShoppingCart.java │ │ ├── ShoppingCartMemento.java │ │ └── ShoppingCartVersionContainer.java ├── SingletonPattern │ ├── .idea │ │ ├── .gitignore │ │ ├── misc.xml │ │ └── modules.xml │ ├── SingletonPattern.iml │ └── src │ │ ├── SingletonDemo.java │ │ └── Util.java └── StateMachine │ ├── .idea │ ├── .gitignore │ ├── misc.xml │ ├── modules.xml │ └── uiDesigner.xml │ ├── StateMachine.iml │ └── src │ ├── DoneState.java │ ├── InProgressState.java │ ├── ReviewState.java │ ├── StateMachineDemo.java │ ├── TaskContext.java │ ├── TaskState.java │ └── TodoState.java ├── Downcasting.java ├── Enum ├── .idea │ ├── .gitignore │ ├── misc.xml │ └── modules.xml ├── Enum.iml └── src │ └── EnumDemo.java ├── ExceptionHandling ├── ArrayIndexOutOfBound.java ├── FilenotFound_checked.java ├── FinallyDemo.java ├── MultipleCatch.java ├── README.md ├── TryCatch.java ├── Unchecked_Demo.java ├── priceException.java └── trycatchwithfinally ├── Factorial ├── FileOperation ├── .idea │ ├── .gitignore │ ├── misc.xml │ └── modules.xml ├── FileOperation.iml └── src │ └── FileOperationDemo.java ├── FinalKeyword └── Example.java ├── GraphProject └── ConnectedCities.java ├── Hello world ├── Helloworld.java └── README.md ├── IntanceInitializerBlock └── IntanceInitailizerBlock.java ├── IntanceOfVariable └── IntanceOfVariable.java ├── Java ├── Java Abstraction ├── AbstractionExample.java ├── AnimalAbstraction.java ├── Example1.java ├── Javaabstraction.java ├── README.md └── ShapeAbstraction.java ├── Java Array ├── Array2D.java ├── ArrayStarsReverse ├── Example1.java ├── Example2.java ├── Example3.java ├── Example4.java ├── Example5.java ├── Example6.java ├── ForEachArray ├── JavaArrayList.java ├── Javaarray.java ├── LargestElementArray └── README.md ├── Java Date ├── AgeCalculator.java └── JavaDate.java ├── Java Encapsulation ├── Javaencapsulation.java └── README.md ├── Java Inheritance ├── HierarchicalInheritance.java ├── InheritanceinAnimal ├── Maruti800.java ├── Programmer.java ├── README.md ├── SingleInheritance.java └── inheritance Example.java ├── Java Polymorphism ├── Animal.class ├── Animal.java ├── Cat.class ├── Cat.java ├── Dog.class ├── Dog.java ├── Pets.class ├── Pets.java └── README.md ├── Java Recursion ├── Example1.java ├── README.md ├── example2.java └── example3.java ├── Java String ├── AboutString │ ├── CreatingString.java │ ├── StringConcat.java │ └── StringLength.java ├── ArrayOfStrings.java ├── CheckIfPalindrome.java ├── Example1.java ├── Example2.java ├── Example3.java ├── Group Anagrams.java ├── JavaStringExample.java ├── PasswordValidator.java ├── README.md ├── StringRegionMatch.java └── StringReverse.java ├── Java classes and objects ├── Bicycles Example.java ├── Javaclassandobject.java ├── Matrix Multiplication.java └── README.md ├── LICENSE.md ├── Lamda ├── .idea │ ├── .gitignore │ ├── misc.xml │ └── modules.xml ├── Lamda.iml └── src │ ├── Employee.java │ ├── EmployeeComparator.java │ ├── EmployeeDataLoader.java │ └── StreamFilterDemo.java ├── Loops ├── .idea │ └── workspace.xml ├── AllLoopExamples.java ├── DiamondPatternUsingForLoop ├── Do While │ ├── .idea │ │ ├── .gitignore │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── kotlinc.xml │ │ ├── libraries │ │ │ └── KotlinJavaRuntime.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── vcs.xml │ ├── Do While.iml │ ├── Do_fact │ ├── out │ │ └── production │ │ │ └── Do While │ │ │ └── DoWhileExample.class │ └── src │ │ └── DoWhileExample.java ├── DoWhileLoop.java ├── For Loop │ ├── .idea │ │ ├── .gitignore │ │ ├── .name │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── kotlinc.xml │ │ ├── libraries │ │ │ └── KotlinJavaRuntime.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── vcs.xml │ ├── Factorial │ ├── ForLoopExample1.java │ ├── ForLoopExample2.java │ ├── Multiplication │ ├── README.md │ ├── for_loop_array_elements.PNG │ ├── out │ │ └── production │ │ │ └── ForLoop │ │ │ └── ForLoopExample.class │ └── src │ │ ├── ForLoop.iml │ │ └── ForLoopExample.java ├── NestedLoop.java ├── NumberPattern.java ├── README.md ├── While Loop │ ├── .idea │ │ ├── .gitignore │ │ ├── .name │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── kotlinc.xml │ │ ├── libraries │ │ │ └── KotlinJavaRuntime.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── vcs.xml │ ├── While Loop.iml │ ├── fact_while │ ├── out │ │ └── production │ │ │ └── While Loop │ │ │ └── WhileLoopExample.class │ └── src │ │ └── WhileLoopExample.java ├── WhileLoop.java └── palindrome.java ├── Methods ├── Java Methods │ ├── Simple.class │ └── Simple.java ├── Methods with Parameters │ ├── Intermediate.class │ ├── Intermediate.java │ ├── Simple.class │ └── Simple.java ├── README.md ├── build.xml ├── build │ └── classes │ │ ├── .netbeans_automatic_build │ │ ├── .netbeans_update_resources │ │ ├── methods │ │ ├── BeansC.class │ │ ├── Methods.class │ │ ├── Neeeeeew.class │ │ ├── a.class │ │ ├── aClass.class │ │ ├── accesModifier.class │ │ ├── accesModifier2.class │ │ ├── accesModifier3.class │ │ ├── calcu.class │ │ ├── deposit.class │ │ ├── get.class │ │ ├── getSetter.class │ │ ├── height.class │ │ ├── length.class │ │ ├── main.class │ │ ├── majd.class │ │ ├── objects.class │ │ ├── random.class │ │ ├── sameer.class │ │ ├── set.class │ │ ├── supeR.class │ │ ├── test.class │ │ ├── width.class │ │ └── withdraw.class │ │ └── neeeeeew │ │ ├── Neeeeeew.class │ │ ├── a.class │ │ ├── deposit.class │ │ ├── random.class │ │ ├── sameer.class │ │ ├── test.class │ │ └── withdraw.class ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ └── methods │ ├── BeansC.java │ ├── Methods.java │ ├── Neeeeeew.java │ ├── a.java │ ├── aClass.java │ ├── accesModifier.java │ ├── accesModifier2.java │ ├── accesModifier3.java │ ├── calcu.java │ ├── deposit.java │ ├── get.java │ ├── getSetter.java │ ├── height.java │ ├── length.java │ ├── main.java │ ├── majd.java │ ├── objects.java │ ├── random.java │ ├── sameer.java │ ├── set.java │ ├── supeR.java │ ├── test.java │ ├── width.java │ └── withdraw.java ├── Operators ├── Arithmetic.class ├── Arithmetic.java ├── Assignment.class ├── Assignment.java ├── BitwiseOperator ├── Comparison.class ├── Comparison.java ├── README.md ├── RightOrLeftShiftOperator └── subtract.java ├── Patterns and Series in Java ├── FibonacciSeries.java ├── More Patterns In Java │ ├── MorePatterns.java │ └── Pattern_Output.png └── TrianglePatterns.java ├── Projects ├── Calculator │ ├── Calculator.java │ ├── image1.png │ └── image2.png ├── FrequencyOfCharacters ├── JavaFX GUI Calculator (Simple) │ ├── Controller.java │ ├── Main.java │ └── sample.fxml ├── Puzzle Project │ ├── 1.jpg │ ├── 10.jpg │ ├── 11.jpg │ ├── 12.jpg │ ├── 13.jpg │ ├── 14.jpg │ ├── 15.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ ├── 8.jpg │ ├── 9.jpg │ ├── blank.jpg │ ├── f1.jpg │ ├── main.jpg │ ├── pz.java │ └── test1.java ├── Snake Game │ ├── SnakeGame.java │ ├── SnakeGamePlay.java │ └── images │ │ ├── downmouth.png │ │ ├── enemy.png │ │ ├── leftmouth.png │ │ ├── rightmouth.png │ │ ├── snakeimage.png │ │ ├── snaketitle.jpg │ │ └── upmouth.png ├── Temperature Converter │ ├── Output.png │ └── Temperature_Converter.java ├── Text Cipher Decipher │ └── Project.java ├── Tic Tac Toe Game │ └── TicTacToe.java ├── UtilityProgram │ ├── README.md │ ├── Server.java │ └── UtilityProgram.java └── VirtualPiano │ ├── build.xml │ ├── build │ ├── built-jar.properties │ └── classes │ │ ├── .netbeans_automatic_build │ │ ├── .netbeans_update_resources │ │ ├── VirtualPiano$1.class │ │ ├── VirtualPiano$10.class │ │ ├── VirtualPiano$11.class │ │ ├── VirtualPiano$12.class │ │ ├── VirtualPiano$13.class │ │ ├── VirtualPiano$14.class │ │ ├── VirtualPiano$15.class │ │ ├── VirtualPiano$16.class │ │ ├── VirtualPiano$17.class │ │ ├── VirtualPiano$18.class │ │ ├── VirtualPiano$19.class │ │ ├── VirtualPiano$2.class │ │ ├── VirtualPiano$20.class │ │ ├── VirtualPiano$3.class │ │ ├── VirtualPiano$4.class │ │ ├── VirtualPiano$5.class │ │ ├── VirtualPiano$6.class │ │ ├── VirtualPiano$7.class │ │ ├── VirtualPiano$8.class │ │ ├── VirtualPiano$9.class │ │ ├── VirtualPiano.class │ │ └── VirtualPiano.form │ ├── dist │ ├── README.TXT │ └── VirtualPiano.jar │ ├── manifest.mf │ ├── music notes │ ├── Music_Note.zip │ └── Music_Note │ │ ├── A.wav │ │ ├── A_Drum.wav │ │ ├── B.wav │ │ ├── B_Drum.wav │ │ ├── Bb.wav │ │ ├── Bb_Drum.wav │ │ ├── C.wav │ │ ├── C1.wav │ │ ├── C1_Drum.wav │ │ ├── C_Drum.wav │ │ ├── C_s.wav │ │ ├── C_s1.wav │ │ ├── Cq1_Drum.wav │ │ ├── Cq_Drum.wav │ │ ├── D.wav │ │ ├── D1.wav │ │ ├── D1_Drum.wav │ │ ├── D_Drum.wav │ │ ├── D_s.wav │ │ ├── D_s1.wav │ │ ├── Dq1_Drum.wav │ │ ├── Dq_Drum.wav │ │ ├── E.wav │ │ ├── E1.wav │ │ ├── E1_Drum.wav │ │ ├── E_Drum.wav │ │ ├── F.wav │ │ ├── F1.wav │ │ ├── F1_Drum.wav │ │ ├── F_Drum.wav │ │ ├── F_s.wav │ │ ├── Fq_Drum.wav │ │ ├── G.wav │ │ ├── G_Drum.wav │ │ ├── G_s.wav │ │ └── Gq_Drum.wav │ ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml │ └── src │ ├── VirtualPiano.form │ └── VirtualPiano.java ├── Python ├── README.md ├── RealLifeExample.java ├── RunTimePolymorphism ├── Animal.java └── Food.java ├── SceintficCalculator ├── build.xml ├── build │ └── classes │ │ ├── .netbeans_automatic_build │ │ ├── .netbeans_update_resources │ │ ├── FOR │ │ ├── FOR.class │ │ ├── Star.class │ │ └── Table.class │ │ ├── Truck.class │ │ ├── category │ │ ├── Category.class │ │ └── SecondCategory.class │ │ ├── dowhile │ │ └── DoWhile.class │ │ ├── evenno │ │ └── EvenNo.class │ │ ├── fabuna │ │ └── Fabuna.class │ │ ├── findage │ │ └── Findage.class │ │ ├── marksheet │ │ └── Marksheet.class │ │ ├── pQueue.class │ │ ├── pkgswitch │ │ └── Switch.class │ │ ├── sceintficcalculator │ │ ├── AdCalculator.class │ │ ├── BEans1.class │ │ ├── Beans.class │ │ ├── Calculator.class │ │ ├── Calculatorsw.class │ │ ├── DoubletoInt.class │ │ ├── EvenNo.class │ │ ├── Opp.class │ │ ├── SceintficCalculator.class │ │ ├── StringForm.class │ │ ├── test.class │ │ └── test2.class │ │ ├── stackprogrm.class │ │ ├── submarks │ │ └── SubMarks.class │ │ ├── switchcalculator │ │ ├── DoubletoInt.class │ │ └── SwitchCalculator.class │ │ └── vowels │ │ └── Vowels.class ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ └── sceintficcalculator │ ├── AdCalculator.java │ ├── BEans1.java │ ├── Beans.java │ ├── Calculator.java │ ├── Calculatorsw.java │ ├── Category.java │ ├── DoWhile.java │ ├── DoubletoInt.java │ ├── EvenNo.java │ ├── FOR.java │ ├── Fabuna.java │ ├── Findage.java │ ├── Marksheet.java │ ├── Opp.java │ ├── SceintficCalculator.java │ ├── SecondCategory.java │ ├── Star.java │ ├── StringForm.java │ ├── SubMarks.java │ ├── Switch.java │ ├── SwitchCalculator.java │ ├── Table.java │ ├── Truck.java │ ├── Vowels.java │ ├── pQueue.java │ ├── stackprogrm.java │ ├── test.java │ └── test2.java ├── Search └── binarySearch.java ├── Sorting ├── CombSort.java ├── CountingSort.java ├── InsertSort.java ├── Pigeonhole_sort.java ├── QuickSortLinkedList.java ├── QuickSort__Doubly_Linkedlist.java ├── Radix_sort.java ├── ShellSort.java ├── TimSort.java ├── bubbleSort.java ├── bucket_sort.java ├── cocktailSort.java ├── cycle_sort.java ├── heapSort.java ├── iterative_QuickSort.java ├── iterative_bubbleSort.java ├── linked_list_merge_sort.java ├── mergeSort.java ├── oddEvenSort.java ├── quickSort.java ├── readme.md ├── selectionSort.java ├── singly_linked_merge_sort.java ├── tagSort.java ├── three_way_merge_sort .java └── treeSort.java ├── StringBuilder_and_StringBuffer ├── About Immutability of Strings.md ├── StringBufferDemo.java ├── StringBuilderDemo.java └── StringImmutabilityDemo.java ├── StringFunctions.java ├── SuperAndThisKeyword ├── Animal.java ├── AnimalParentClass.java ├── RealUse.java └── SuperClass.java ├── Thread ├── .idea │ ├── .gitignore │ ├── misc.xml │ └── modules.xml ├── Readme.MD ├── Thread.iml └── src │ ├── ConcurrencyHandlingDemo.java │ ├── FirstThread.java │ ├── SecondThread.java │ └── ThreadDemo.java ├── TicTacToe ├── build.xml ├── build │ └── classes │ │ ├── .netbeans_automatic_build │ │ ├── .netbeans_update_resources │ │ ├── java_tictactoe_game │ │ ├── TicTacToe_Game$1.class │ │ ├── TicTacToe_Game$2.class │ │ └── TicTacToe_Game$3.class │ │ └── tictactoe │ │ ├── TicTacToe_Game$1.class │ │ ├── TicTacToe_Game$2.class │ │ ├── TicTacToe_Game$3.class │ │ ├── TicTacToe_Game$4.class │ │ ├── TicTacToe_Game$5.class │ │ ├── TicTacToe_Game.class │ │ └── TicTacToe_Game.form ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ └── tictactoe │ ├── TicTacToe_Game.form │ └── TicTacToe_Game.java ├── TreeApp-master └── TreeApp.java ├── Varialble and Data types ├── README.md └── datatypexample.java ├── WrapperClass.java ├── defaultAccessModifier └── DefaultAccessModifier.java ├── hashMap.java ├── hashsett.java ├── interface ├── build.xml ├── build │ └── classes │ │ ├── .netbeans_automatic_build │ │ ├── .netbeans_update_resources │ │ └── pkginterface │ │ ├── A.class │ │ ├── B.class │ │ ├── NewInterface.class │ │ ├── areaMathmain.class │ │ ├── areaVolume.class │ │ ├── c.class │ │ ├── interfac.class │ │ ├── main.class │ │ └── mathfun.class ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml └── src │ └── pkginterface │ ├── A.java │ ├── B.java │ ├── NewInterface.java │ ├── areaMathmain.java │ ├── areaVolume.java │ ├── c.java │ ├── interfac.java │ ├── main.java │ └── mathfun.java ├── palindrome ├── readme_for_tictactoe.md └── tictactoe.java /.idea/.name: -------------------------------------------------------------------------------- 1 | ForLoopExample -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/libraries/KotlinJavaRuntime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AJFoods-master/diet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/AJFoods-master/diet.png -------------------------------------------------------------------------------- /AJFoods-master/homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/AJFoods-master/homepage.png -------------------------------------------------------------------------------- /AJFoods-master/spaguetti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/AJFoods-master/spaguetti.png -------------------------------------------------------------------------------- /Aggregation/Address.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package Aggregation; 7 | 8 | /** 9 | * 10 | * @author Ahsan Qadeer 11 | */ 12 | public class Address { 13 | String city, province, country; 14 | public Address (String city, String province, String country) 15 | { 16 | this.city=city; 17 | this.province=province; 18 | this.country=country; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BarcodeGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | */ 3 | 4 | import java.util.Random; // make sure to write the import for Random class 5 | 6 | /** 7 | * 8 | * @author ahsan 9 | */ 10 | public class BarcodeGenerator 11 | { 12 | public String generateBarcode() 13 | { 14 | String barcode; 15 | String[] numbers={"0","1","2","3","4","5","6","7","8","9"}; 16 | String[] Alphabets ={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; 17 | Random random = new Random(); //creating instance of Random class 18 | int n1=random.nextInt(10); // generating a random number 19 | int n2=random.nextInt(10); 20 | int n3=random.nextInt(10); 21 | int n4=random.nextInt(10); 22 | // now creating barcode using random numbers i-e n1, n2 23 | barcode= numbers[n1]+numbers[n2]+numbers[n3]+numbers[n4]; 24 | return barcode; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "Learn-to-code-java" will be documented in this file. 4 | 5 | ## [1.0.0] (Released)Learn-to-code-java 6 | - Added Code and README files, Added By [@owais4321](https://github.com/owais4321). 7 | 8 | 9 | -------------------------------------------------------------------------------- /Conditional Structures/IfAllConditionsExample.java: -------------------------------------------------------------------------------- 1 | public class IfAllConditionsExample { 2 | public static void main(String[] args) { 3 | int day = 5; 4 | int month = 10; 5 | int year= 2020; 6 | 7 | if (year >= 2020) { 8 | System.out.println("The year is greater or equal to 2020"); 9 | } else { 10 | System.out.println("The year is lower than 2020"); 11 | } 12 | 13 | if (month >= 11) { 14 | System.out.println("It's a winter month"); 15 | } else { 16 | System.out.println("It's not a winter month"); 17 | } 18 | 19 | if (day == 1) { 20 | System.out.println("It's Sunday"); 21 | } else if(day > 1 && day <= 6) { 22 | System.out.println("It's a work day"); 23 | } else { 24 | System.out.println("It's Saturday"); 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Conditional Structures/Ifconditionexample.java: -------------------------------------------------------------------------------- 1 | public class IfconditionExample { 2 | public static void main(String[] args) { 3 | int x = 20; 4 | int y = 18; 5 | if (x > y) { 6 | System.out.println("x is greater than y"); 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Conditional Structures/IfelseconditionExample.java: -------------------------------------------------------------------------------- 1 | 2 | public class IfelseconditionExample { 3 | public static void main(String[] args) { 4 | int time = 20; 5 | if (time < 18) { 6 | System.out.println("Good day."); 7 | } else { 8 | System.out.println("Good evening."); 9 | } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Conditional Structures/NestedIfConditionsExample.java: -------------------------------------------------------------------------------- 1 | 2 | public class NestedIfConditionsExample { 3 | public static void main(String[] args) { 4 | int age = 18; 5 | if (age <= 18){ 6 | System.out.println("Child"); 7 | if (age >= 13){ 8 | System.out.println("Teenager"); 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Conditional Structures/README.md: -------------------------------------------------------------------------------- 1 | # Java Conditions and If Statements 2 | 3 | ## Java supports the usual logical conditions from mathematics: 4 | 5 | Less than: a < b 6 | Less than or equal to: a <= b 7 | Greater than: a > b 8 | Greater than or equal to: a >= b 9 | Equal to a == b 10 | Not Equal to: a != b 11 | 12 | ## You can use these conditions to perform different actions for different decisions. 13 | 14 | ## Java has the following conditional statements: 15 | 16 | - Use if to specify a block of code to be executed, if a specified condition is true 17 | - Use else to specify a block of code to be executed, if the same condition is false. Else is always used after an if block. 18 | - Use else if to specify a new condition to test, if the first condition is false. Else If is also used after an If condition. 19 | -------------------------------------------------------------------------------- /Conditional Structures/switchExample.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | class switchExample { 3 | public static void main(String[] args) { 4 | Scanner sc = new Scanner(System.in); 5 | System.out.print("Enter the Size of your shirt in inches : "); 6 | float inches = sc.nextFloat(); 7 | int number = (int)inches/10; 8 | String size; 9 | switch (number) { 10 | 11 | case 3: 12 | size = "Small"; 13 | break; 14 | 15 | case 4: 16 | size = "Medium"; 17 | break; 18 | 19 | case 5: 20 | size = "Large"; 21 | break; 22 | 23 | case 6: 24 | size = "Extra Large"; 25 | break; 26 | 27 | default: 28 | size = "Unknown"; 29 | break; 30 | } 31 | System.out.println("You will get a " + size + " shirt"); 32 | } 33 | } -------------------------------------------------------------------------------- /CovarianceReturnType/SuperClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package CovarianceReturnType; 7 | 8 | /** 9 | * 10 | * @author Saqib Ghouri 11 | */ 12 | public class SuperClass { 13 | SuperClass get(){return this; 14 | } 15 | void message(){ 16 | System.out.println("CovarianceReturnType.SuperClass.message()");} 17 | } 18 | class SubClass extends SuperClass{ 19 | SubClass get(){ 20 | return this; 21 | } 22 | void message(){ 23 | System.out.println("CovarianceReturnType.SubClass.message()"); 24 | } 25 | public static void main(String args[]){ 26 | new SubClass().get().message(); 27 | new SuperClass().get().message(); 28 | 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Data Structures & Algorithm/Arrays/ArrayElementEvenOrOdd.java: -------------------------------------------------------------------------------- 1 | public class ArrayElementEvenOrOdd{ 2 | public static void main(String[]args) 3 | { 4 | int []arr = {3,5,6,3,4,8,6,7}; 5 | for(int i=0;i 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern/DesignPattern.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/FactoryPattern.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/src/FactoryDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Every sport should be extended from Sport Class. 3 | * Then override the description method according to sport. 4 | * getting actual object at runtime and execute the program 5 | */ 6 | public class FactoryDemo { 7 | 8 | public static void main(String[] args) { 9 | Sport rugby = SportFactory.getSport(Sport.RUGBY); 10 | System.out.println(rugby.description()); 11 | Sport volleyBall = SportFactory.getSport(Sport.VOLLEYBALL); 12 | System.out.println(volleyBall.description()); 13 | Sport footBall = SportFactory.getSport(Sport.FOOTBALL); 14 | System.out.println(footBall.description()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/src/FootBall.java: -------------------------------------------------------------------------------- 1 | public class FootBall extends Sport{ 2 | 3 | public FootBall() { 4 | this.code = Sport.FOOTBALL; 5 | } 6 | 7 | @Override 8 | public String description() { 9 | return "FootBall is popular game and A match is played with 2 teams and each team should have maximum 11 players."; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/src/Rugby.java: -------------------------------------------------------------------------------- 1 | public class Rugby extends Sport{ 2 | 3 | public Rugby() { 4 | this.code = Sport.RUGBY; 5 | } 6 | 7 | @Override 8 | public String description() { 9 | return "Rugby is popular game and A match is played with 2 teams and each team should have maximum 15 players."; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/src/Sport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Sport is abstract class, it is used for store common things for all sports. 3 | */ 4 | public abstract class Sport { 5 | 6 | public static final String FOOTBALL = "FOOTBALL"; 7 | public static final String VOLLEYBALL = "VOLLEYBALL"; 8 | public static final String RUGBY = "RUGBY"; 9 | 10 | public String code = ""; 11 | 12 | /** 13 | * please, specify sport description here. 14 | * @return 15 | */ 16 | public String description() { 17 | return "please, specify sport description here."; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/src/SportFactory.java: -------------------------------------------------------------------------------- 1 | public class SportFactory { 2 | 3 | /** 4 | * getting code from argument and creating actual object using code 5 | * it is called polymorphism and one object has multiple shapes. 6 | * @param code 7 | * @return 8 | */ 9 | public static Sport getSport(String code) { 10 | Sport sport = null; 11 | if (Sport.RUGBY.equals(code)){ 12 | sport = new Rugby(); 13 | } else if (Sport.FOOTBALL.equals(code)){ 14 | sport = new FootBall(); 15 | } else if (Sport.VOLLEYBALL.equals(code)){ 16 | sport = new VolleyBall(); 17 | } 18 | return sport; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern/FactoryPattern/src/VolleyBall.java: -------------------------------------------------------------------------------- 1 | public class VolleyBall extends Sport { 2 | 3 | public VolleyBall() { 4 | this.code = Sport.VOLLEYBALL; 5 | } 6 | 7 | @Override 8 | public String description() { 9 | return "VolleyBall is popular game and A match is played with 2 teams and each team should have maximum 6 players."; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\Momento\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/MementoPattern.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/src/ShoppingCart.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the original object, 3 | * updated values are effected to this object. 4 | */ 5 | public class ShoppingCart { 6 | 7 | public int numOfItems = 0; 8 | public double totalPrice = 0.00d; 9 | public int version = 0; 10 | 11 | public ShoppingCartMemento createVersion(){ 12 | ShoppingCartMemento shoppingCartMemento = new ShoppingCartMemento(); 13 | shoppingCartMemento.numOfItems = this.numOfItems; 14 | shoppingCartMemento.totalPrice = this.totalPrice; 15 | shoppingCartMemento.version = this.version; 16 | return shoppingCartMemento; 17 | } 18 | 19 | public void restore(ShoppingCartMemento shoppingCartMemento){ 20 | this.version = shoppingCartMemento.version; 21 | this.numOfItems = shoppingCartMemento.numOfItems; 22 | this.totalPrice = shoppingCartMemento.totalPrice; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/src/ShoppingCartMemento.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the class for keep the versioning of 3 | * Shopping Cart 4 | */ 5 | public class ShoppingCartMemento { 6 | public int numOfItems = 0; 7 | public double totalPrice = 0.00d; 8 | public int version = 0; 9 | } 10 | -------------------------------------------------------------------------------- /DesignPattern/MementoPattern/src/ShoppingCartVersionContainer.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | 4 | public class ShoppingCartVersionContainer { 5 | 6 | List shoppingCartVersions = new ArrayList<>(); 7 | 8 | public void addToContainer(ShoppingCartMemento shoppingCartMemento){ 9 | this.shoppingCartVersions.add(shoppingCartMemento); 10 | } 11 | 12 | public ShoppingCartMemento getVersion(int version) { 13 | for (ShoppingCartMemento shoppingCartMemento : shoppingCartVersions) { 14 | if (shoppingCartMemento.version == version){ 15 | return shoppingCartMemento; 16 | } 17 | } 18 | return null; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DesignPattern/SingletonPattern/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\Singleton\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /DesignPattern/SingletonPattern/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern/SingletonPattern/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DesignPattern/SingletonPattern/SingletonPattern.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern/SingletonPattern/src/SingletonDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Every project has Utility or Helper class for 3 | * which are used for store common attributes and common functions. 4 | * Since these attribute and functions are common to the whole project, 5 | * We don't need to create multiple objects. 6 | * We would say one object is enough for whole project. 7 | */ 8 | public class SingletonDemo { 9 | 10 | public static void main(String[] args) { 11 | //you can't create new object here like below. 12 | //because Util has private constructor 13 | //Util util = new Util(); 14 | 15 | Util util = Util.getUtil(); 16 | util.description(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DesignPattern/SingletonPattern/src/Util.java: -------------------------------------------------------------------------------- 1 | public class Util { 2 | 3 | //create single object for class, 4 | //set private for restricting outside access 5 | private static Util util = new Util(); 6 | 7 | //create private constructor 8 | //Then cannot create object on outside 9 | private Util(){} 10 | 11 | //expose the one and only single object util for outside access 12 | public static Util getUtil(){ 13 | return util; 14 | } 15 | 16 | public void description(){ 17 | System.out.println("Im the one and only util"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\StateMachine\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/StateMachine.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/src/DoneState.java: -------------------------------------------------------------------------------- 1 | public class DoneState implements TaskState{ 2 | @Override 3 | public void processTask(TaskContext context) { 4 | context.setTaskState(this); 5 | System.out.println("Processed Done status successfully."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/src/InProgressState.java: -------------------------------------------------------------------------------- 1 | public class InProgressState implements TaskState{ 2 | @Override 3 | public void processTask(TaskContext context) { 4 | context.setTaskState(this); 5 | System.out.println("Processed InProgress status successfully."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/src/ReviewState.java: -------------------------------------------------------------------------------- 1 | public class ReviewState implements TaskState{ 2 | @Override 3 | public void processTask(TaskContext context) { 4 | context.setTaskState(this); 5 | System.out.println("Processed Review status successfully."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/src/TaskContext.java: -------------------------------------------------------------------------------- 1 | public class TaskContext { 2 | 3 | private TaskState taskState; 4 | 5 | public TaskContext(){ 6 | taskState = null; 7 | } 8 | 9 | public void setTaskState(TaskState taskState){ 10 | this.taskState = taskState; 11 | } 12 | 13 | public TaskState getTaskState(){ 14 | return taskState; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/src/TaskState.java: -------------------------------------------------------------------------------- 1 | public interface TaskState { 2 | public void processTask(TaskContext context); 3 | } 4 | -------------------------------------------------------------------------------- /DesignPattern/StateMachine/src/TodoState.java: -------------------------------------------------------------------------------- 1 | public class TodoState implements TaskState{ 2 | @Override 3 | public void processTask(TaskContext context) { 4 | context.setTaskState(this); 5 | System.out.println("Processed Todo status successfully."); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Downcasting.java: -------------------------------------------------------------------------------- 1 | 2 | // Downcasting is when a child class type reference variable point to/references 3 | // to a parent object or parentclass type 4 | package downcasting; 5 | 6 | class Animal 7 | { 8 | 9 | } 10 | public class Downcasting extends Animal{ 11 | 12 | 13 | static void method(Animal a) { 14 | if(a instanceof Downcasting){ 15 | Downcasting d=(Downcasting)a;//downcasting 16 | System.out.println("ok downcasting performed"); 17 | } 18 | } 19 | 20 | public static void main(String[] args) { 21 | 22 | //downcasting is not possible in this way will give compile-time error 23 | // Downcasting d=new Animal(); 24 | 25 | //Compiles successfully but ClassCastException is thrown at runtime if we use type casting as shown under : 26 | // Dog d=(Dog)new Animal(); 27 | 28 | //but we can do it as under 29 | Animal a=new Downcasting(); 30 | Downcasting.method(a); 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Enum/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\Enum\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Enum/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Enum/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Enum/Enum.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ExceptionHandling/ArrayIndexOutOfBound.java: -------------------------------------------------------------------------------- 1 | // built-in Exception of ArrayIndexOutOfBound 2 | 3 | public class ArrayIndexOutOfBound 4 | { 5 | public static void main(String args[]) 6 | { 7 | try{ 8 | int a[] = new int[5]; 9 | a[6] = 9; 10 | } 11 | catch(ArrayIndexOutOfBoundsException e){ 12 | System.out.println ("Array Index is Out Of Bounds"); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /ExceptionHandling/FilenotFound_checked.java: -------------------------------------------------------------------------------- 1 | //Example of checked Exception (Compile-time Exception) 2 | // the methods read() and close() of FileReader class throws IOException, you can observe that the compiler notifies to handle IOException, along with FileNotFoundException. 3 | 4 | import java.io.File; 5 | import java.io.FileReader; 6 | 7 | public class FilenotFound_checked { 8 | 9 | public static void main(String args[]) { 10 | File file = new File("E://file.txt"); 11 | FileReader fr = new FileReader(file); 12 | } 13 | } -------------------------------------------------------------------------------- /ExceptionHandling/FinallyDemo.java: -------------------------------------------------------------------------------- 1 | 2 | public class FinallyDemo { 3 | 4 | public static void main(String args[]) { 5 | int a[] = new int[2]; 6 | try { 7 | System.out.println("Access element three :" + a[3]); 8 | } catch (ArrayIndexOutOfBoundsException e) { 9 | System.out.println("Exception thrown :" + e); 10 | }finally { 11 | a[0] = 6; 12 | System.out.println("First element value: " + a[0]); 13 | System.out.println("The finally statement is executed"); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /ExceptionHandling/TryCatch.java: -------------------------------------------------------------------------------- 1 | //try and catch example 2 | //The following is an array declared with 2 elements. Then the code tries to access the 3rd element of the array which //throws an exception. 3 | import java.io.*; 4 | 5 | public class TryCatch { 6 | 7 | public static void main(String args[]) { 8 | try { 9 | int a[] = new int[2]; 10 | System.out.println("Access element three :" + a[3]); 11 | } catch (ArrayIndexOutOfBoundsException e) { 12 | System.out.println("Exception thrown :" + e); 13 | } 14 | System.out.println("Out of the block"); 15 | } 16 | } -------------------------------------------------------------------------------- /ExceptionHandling/Unchecked_Demo.java: -------------------------------------------------------------------------------- 1 | //This will give an unchecked exception if you have declared an array of size 5 in your program, and trying to call the 6th //element of the array then an ArrayIndexOutOfBoundsExceptionexception occurs. 2 | public class Unchecked_Demo { 3 | 4 | public static void main(String args[]) { 5 | int num[] = {1, 2, 3, 4}; 6 | System.out.println(num[5]); 7 | } 8 | } -------------------------------------------------------------------------------- /ExceptionHandling/priceException.java: -------------------------------------------------------------------------------- 1 | class InvalidPriceException extends Exception{ 2 | InvalidPriceException(String s){ 3 | super(s); 4 | } 5 | } 6 | class TestCustomException1{ 7 | static void validate(int price)throws InvalidPriceException{ 8 | if(price<0) 9 | throw new InvalidPriceException(price+" is Invalid Price"); 10 | else 11 | System.out.println(price +" is valid price"); 12 | } 13 | public static void main(String args[]){ 14 | try{ 15 | validate(-2); } 16 | catch(Exception m){System.out.println("Exception occured: "+m);} 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ExceptionHandling/trycatchwithfinally: -------------------------------------------------------------------------------- 1 | class trycatchwithfinally 2 | { 3 | public static void main(String args[]) 4 | { 5 | int []num1; 6 | 7 | 8 | 9 | try 10 | { 11 | num1=new int[4]; 12 | System.out.println(num1[3]); 13 | } 14 | 15 | catch(Exception b) 16 | { 17 | System.out.println("Exception found"); 18 | } 19 | 20 | finally 21 | { 22 | System.out.println("Exception differnet"); 23 | 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Factorial: -------------------------------------------------------------------------------- 1 | class Factorial 2 | { 3 | public static void main(String args[]) 4 | { 5 | int number=4; 6 | int fact=1; 7 | for(int i=1;i<=number;i++) 8 | { 9 | fact=fact*i; 10 | 11 | } 12 | System.out.println("Factorial is"+fact); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /FileOperation/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\FileOperation\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /FileOperation/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FileOperation/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FileOperation/FileOperation.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Hello world/Helloworld.java: -------------------------------------------------------------------------------- 1 | public class Helloworld { 2 | public static void main(String[] args) { 3 | System.out.print("Hello World); 4 | System.out.println("Hello World"); 5 | } 6 | } 7 | 8 | -------------------------------------------------------------------------------- /IntanceOfVariable/IntanceOfVariable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package IntanceOfVariable; 7 | 8 | /** 9 | * 10 | * @author Saqib Ghouri 11 | */ 12 | public class IntanceOfVariable { 13 | public static String a; 14 | static{ 15 | a="1"; 16 | } 17 | 18 | public static void main(String args[]) 19 | { 20 | System.out.println(" "+a instanceof String); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Java Abstraction/Example1.java: -------------------------------------------------------------------------------- 1 | abstract class Shape{ 2 | abstract void draw(); 3 | } 4 | //In real scenario, implementation is provided by others i.e. unknown by end user 5 | class Rectangle extends Shape{ 6 | void draw(){System.out.println("drawing rectangle");} 7 | } 8 | class Circle1 extends Shape{ 9 | void draw(){System.out.println("drawing circle");} 10 | } 11 | //In real scenario, method is called by programmer or user 12 | class Example1{ 13 | public static void main(String args[]){ 14 | Shape s=new Circle1();//In a real scenario, object is provided through method, e.g., getShape() method 15 | s.draw(); 16 | } 17 | -------------------------------------------------------------------------------- /Java Abstraction/Javaabstraction.java: -------------------------------------------------------------------------------- 1 | abstract class Bike{ 2 | abstract void run(); 3 | } 4 | class Honda4 extends Bike{ 5 | void run(){ 6 | System.out.println("running safely"); 7 | } 8 | public static void main(String args[]){ 9 | Bike obj = new Honda4(); 10 | obj.run(); 11 | } 12 | } -------------------------------------------------------------------------------- /Java Array/ArrayStarsReverse: -------------------------------------------------------------------------------- 1 | class ArrayStarsReverse 2 | { 3 | public static void main(String args[]) 4 | { 5 | // char matrix[][]={{'*'},{'*','*'},{'*','*','*'}} 6 | char matrix[][]= new char[][]{new char []{'*'} , new char[]{'*', '*'} , new char[]{'*' , '*' , '*'} , new char[]{'*','*','*','*'} , new char[]{'*','*','*','*','*'}}; 7 | for(int i=matrix.length-1;i>=0;i--) 8 | { 9 | for(int j=0;j max) max = myList[i]; 22 | } 23 | System.out.println("Max is " + max); 24 | } 25 | } -------------------------------------------------------------------------------- /Java Array/Example2.java: -------------------------------------------------------------------------------- 1 | public class Example2 { 2 | 3 | public static void main(String args[]) { 4 | int daysInMonth[] = new int[12]; 5 | 6 | daysInMonth[0] = 31; 7 | daysInMonth[1] = 28; 8 | daysInMonth[2] = 31; 9 | daysInMonth[3] = 30; 10 | daysInMonth[4] = 31; 11 | daysInMonth[5] = 30; 12 | daysInMonth[6] = 31; 13 | daysInMonth[8] = 30; 14 | daysInMonth[9] = 31; 15 | daysInMonth[10] = 30; 16 | daysInMonth[11] = 31; 17 | 18 | System.out.println("October has " + daysInMonth[10] + " days."); 19 | } 20 | } -------------------------------------------------------------------------------- /Java Array/Example3.java: -------------------------------------------------------------------------------- 1 | // compute sum and average of array element 2 | public class Example3 { 3 | public static void main(String[] args) { 4 | 5 | int[] numbers = {2, -9, 0, 5, 12, -25, 22, 9, 8, 12}; 6 | int sum = 0; 7 | Double average; 8 | 9 | // access all elements using for each loop 10 | for (int number: numbers) { 11 | sum += number; 12 | } 13 | 14 | // get the total number of elements 15 | int arrayLength = numbers.length; 16 | 17 | // calculate the average 18 | average = ((double)sum / (double)arrayLength); 19 | 20 | System.out.println("Sum = " + sum); 21 | System.out.println("Average = " + average); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Java Array/Example5.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | 6 | // Creating 2-D array 7 | int[][] array = {{10,20,30},{40,50,60}}; 8 | // Extracting elements using for-each loop 9 | for (int[] i : array){ 10 | for (int j : i){ 11 | System.out.println("Element in array is : " + j); 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Java Array/Example6.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | 6 | // Creating 3-D array 7 | int[][][] array = {{{10,20,30},{40,50,60},{70,80,90}}}; 8 | // Extracting elements using for-each loop 9 | for (int[][] i : array){ 10 | for (int[] j : i){ 11 | for (int k : j){ 12 | System.out.println("Element in array is : " + k); 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Java Array/ForEachArray: -------------------------------------------------------------------------------- 1 | //for each program 2 | 3 | 4 | class ForEachArray 5 | { 6 | public static void main(String args[]) 7 | 8 | { 9 | int numbers[]={1,2,3,4,5,6}; 10 | 11 | for(int num: numbers) 12 | { 13 | System.out.println(num); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Java Array/Javaarray.java: -------------------------------------------------------------------------------- 1 | class Javaarray { 2 | public static void main(String[] args) { 3 | 4 | // create an array 5 | int[] age = {12, 4, 5, 2, 5}; 6 | 7 | // Accessing elements using for loop 8 | for (int i = 0 ; i < age.length ; i++){ 9 | System.out.println("Element on index " + i + " is " + age[i]); 10 | } 11 | 12 | // access each array elements 13 | // System.out.println("Accessing Elements of Array:"); 14 | // System.out.println("First Element: " + age[0]); 15 | // System.out.println("Second Element: " + age[1]); 16 | // System.out.println("Third Element: " + age[2]); 17 | // System.out.println("Fourth Element: " + age[3]); 18 | // System.out.println("Fifth Element: " + age[4]); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Java Array/LargestElementArray: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | class LargestElementArray 3 | { 4 | public static void main(String args[]) 5 | { 6 | 7 | int max; 8 | Scanner x=new Scanner(System.in); 9 | System.out.println("Enter number of elements in array"); 10 | 11 | int n=x.nextInt(); 12 | int a[]=new int[n]; 13 | System.out.println("Enter elements of array"); 14 | 15 | for(int i=0;i 0) { 10 | return n * calculateFactorial(n - 1); 11 | } else { 12 | return 1; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Java Recursion/example2.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class example2 { 4 | 5 | // fibonacci series : 1 1 2 3 5 .. (fib(n-1) + fib(n-2)) .. fib(n) 6 | 7 | // return the value of n-th number of fibonacci 8 | static int fibonacci(int n) { 9 | // recursive base 10 | if (n <= 1) { 11 | return n; 12 | } else { 13 | return (fibonacci(n - 1) + fibonacci(n - 2)); 14 | } 15 | } 16 | 17 | public static void main(String[] args) { 18 | 19 | Scanner in = new Scanner(System.in); 20 | System.out.print("Enter n-th series of fibonacci : "); 21 | int n = in.nextInt(); 22 | 23 | for (int num = 1; num <= n; num++) { 24 | System.out.print(fibonacci(num) + " "); 25 | } 26 | in.close(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Java String/AboutString/CreatingString.java: -------------------------------------------------------------------------------- 1 | public class CreatingString { 2 | 3 | public static void main(String args[]) { 4 | char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.' }; 5 | String helloString = new String(helloArray); 6 | System.out.println( helloString ); 7 | } 8 | } -------------------------------------------------------------------------------- /Java String/AboutString/StringConcat.java: -------------------------------------------------------------------------------- 1 | public class StringConcat { 2 | 3 | public static void main(String args[]) { 4 | String str = "this is me "; 5 | System.out.println("Hello " + str + "Afshan!"); 6 | } 7 | } -------------------------------------------------------------------------------- /Java String/AboutString/StringLength.java: -------------------------------------------------------------------------------- 1 | public class StringLength { 2 | 3 | public static void main(String args[]) { 4 | String str = "My name is afshan"; 5 | int len = str.length(); 6 | System.out.println( "String Length is : " + len ); 7 | } 8 | } -------------------------------------------------------------------------------- /Java String/ArrayOfStrings.java: -------------------------------------------------------------------------------- 1 | public class ArrayOfStrings { 2 | public static void main(String args[]) { 3 | String stringArray[] = {"Hello ", " how", " are", " you", " welcome", " to", " Tutorialspoint"}; 4 | StringBuffer sb = new StringBuffer(); 5 | for(int i = 0; i < stringArray.length; i++) { 6 | sb.append(stringArray[i]); 7 | } 8 | String str = sb.toString(); 9 | System.out.println(str); 10 | } 11 | } -------------------------------------------------------------------------------- /Java String/Example1.java: -------------------------------------------------------------------------------- 1 | public class Example1 { 2 | 3 | public static void main(String[] args) { 4 | String greeting = "Hello, world!"; 5 | 6 | System.out.println("The length of the greeting string is: " + greeting.length()); // Outputs 13 7 | 8 | System.out.println(greeting.toUpperCase()); // Outputs "HELLO, WORLD!" 9 | System.out.println(greeting.toLowerCase()); // Outputs "hello, world!" 10 | } 11 | } -------------------------------------------------------------------------------- /Java String/Example2.java: -------------------------------------------------------------------------------- 1 | class Example2 { 2 | public static void main(String[] args) { 3 | 4 | // create strings 5 | String first = "java programming"; 6 | String second = "java programming"; 7 | String third = "python programming"; 8 | 9 | // compare first and second strings 10 | boolean result1 = first.equals(second); 11 | System.out.println("Strings first and second are equal: " + result1); 12 | 13 | //compare first and third strings 14 | boolean result2 = first.equals(third); 15 | System.out.println("Strings first and third are equal: " + result2); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Java String/Example3.java: -------------------------------------------------------------------------------- 1 | public class Example3 { 2 | public static void main(String[] args) { 3 | 4 | // create string using the new keyword 5 | String example = new String("Hello! World"); 6 | 7 | // returns the substring World 8 | System.out.println("Using the subString(): " + example.substring(7)); 9 | 10 | // replaces the character '!' with 'o' 11 | System.out.println("Using the replace(): " + example.replace('!', 'o')); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Java String/StringReverse.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class StringReverse { 3 | 4 | public static void main(String[] args) 5 | { 6 | String s=" I LOVE JAVA, THE COFFEE "; 7 | int i=s.length()-1; 8 | String ans=""; 9 | while(i>=0) { 10 | while(i>=0 && s.charAt(i)==' ' ) i--; 11 | int j=i; 12 | if(i<0) break; 13 | while(i>=0 && s.charAt(i)!=' ')i--; 14 | if(ans.isEmpty()) 15 | ans=ans.concat(s.substring(i+1,j+1)); //j+1 th character is not included 16 | else 17 | ans=ans.concat(" "+s.substring(i+1,j+1)); 18 | } 19 | System.out.println(ans); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Java classes and objects/Javaclassandobject.java: -------------------------------------------------------------------------------- 1 | class Lamp { 2 | boolean isOn; 3 | 4 | void turnOn() { 5 | // initialize variable with value true 6 | isOn = true; 7 | System.out.println("Light on? " + isOn); 8 | 9 | } 10 | 11 | void turnOff() { 12 | // initialize variable with value false 13 | isOn = false; 14 | System.out.println("Light on? " + isOn); 15 | } 16 | } 17 | 18 | 19 | class Main { 20 | public static void main(String[] args) { 21 | 22 | // create objects l1 and l2 23 | Lamp l1 = new Lamp(); 24 | Lamp l2 = new Lamp(); 25 | 26 | // call methods turnOn() and turnOff() 27 | l1.turnOn(); 28 | l2.turnOff(); 29 | } -------------------------------------------------------------------------------- /Lamda/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\Lamda\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Lamda/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lamda/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Lamda/Lamda.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lamda/src/EmployeeComparator.java: -------------------------------------------------------------------------------- 1 | import java.util.Comparator; 2 | 3 | public class EmployeeComparator implements Comparator { 4 | @Override 5 | public int compare(Employee e1, Employee e2) { 6 | if (e1.getEmployeeNumber() < e2.getEmployeeNumber()) { 7 | return -1; 8 | } else if (e1.getEmployeeNumber() > e2.getEmployeeNumber()) { 9 | return 1; 10 | } else { 11 | return 0; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Loops/DiamondPatternUsingForLoop: -------------------------------------------------------------------------------- 1 | class Diamond 2 | { 3 | public static void main(String args[]) 4 | { 5 | for(int i=0;i<=5;i++) 6 | { 7 | for(int j=i;j<5;j++) 8 | { 9 | System.out.print(" "); 10 | } 11 | for(int k=1;k<(i*2);k++) 12 | { 13 | System.out.print("*"); 14 | } 15 | System.out.println(); 16 | } 17 | for(int i=4;i>=1;i--) 18 | { 19 | for(int j=5;j>i;j--) 20 | { 21 | System.out.print(" "); 22 | } 23 | for(int k=1;k<(i*2);k++) 24 | { 25 | System.out.print("*"); 26 | } 27 | System.out.println(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Loops/Do While/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /Loops/Do While/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /Loops/Do While/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Loops/Do While/.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Loops/Do While/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Loops/Do While/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Loops/Do While/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Loops/Do While/Do While.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Loops/Do While/Do_fact: -------------------------------------------------------------------------------- 1 | 2 | import java.util.Scanner; 3 | 4 | class Fact1 5 | { 6 | public static void main(String arg[]) 7 | 8 | { 9 | 10 | long n,fact=1; 11 | 12 | Scanner sc=new Scanner(System.in); 13 | 14 | System.out.println("enter number"); 15 | 16 | n=sc.nextLong(); 17 | 18 | int i=1; 19 | 20 | do 21 | { 22 | fact=fact*i; 23 | i++; 24 | } 25 | while(i<=n); 26 | 27 | 28 | 29 | System.out.println("fact="+fact); 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Loops/Do While/out/production/Do While/DoWhileExample.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Loops/Do While/out/production/Do While/DoWhileExample.class -------------------------------------------------------------------------------- /Loops/Do While/src/DoWhileExample.java: -------------------------------------------------------------------------------- 1 | public class DoWhileExample { 2 | public static void main(String[] args) { 3 | int i=1; 4 | do{ 5 | System.out.println(i); 6 | i++; 7 | }while(i<=10); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Loops/DoWhileLoop.java: -------------------------------------------------------------------------------- 1 | class DoWhileLoop{ 2 | public static void main(String[] args){ 3 | // Print Numbers from 1 to 10 4 | int i=1; 5 | do{ 6 | System.out.println(i); 7 | i++; 8 | } while(i<11); 9 | 10 | // Find Even Numbers between 0 to 20 11 | int j=0; 12 | do{ 13 | if(j%2==0) 14 | System.out.println(j); 15 | j++; 16 | } while(j<=20); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Loops/For Loop/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /Loops/For Loop/.idea/.name: -------------------------------------------------------------------------------- 1 | ForLoop -------------------------------------------------------------------------------- /Loops/For Loop/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /Loops/For Loop/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Loops/For Loop/.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Loops/For Loop/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Loops/For Loop/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Loops/For Loop/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Loops/For Loop/Factorial: -------------------------------------------------------------------------------- 1 | Factorial: The product of an integer and all the integers below it; e.g. factorial four ( 4! ) is equal to 24. 2 | 3 | public class factorial { 4 | 5 | public static void main(String[] args) { 6 | 7 | //We will find the factorial of this number 8 | int number = 5; 9 | long fact = 1; 10 | for(int i = 1; i <= number; i++) 11 | { 12 | fact = fact * i; 13 | } 14 | System.out.println("Factorial of "+number+" is: "+fact); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Loops/For Loop/ForLoopExample1.java: -------------------------------------------------------------------------------- 1 | //infinte loop 2 | 3 | public class InfiniteLoop { 4 | public static void main(String args[]){ 5 | for(int i=1; i>=1; i++){ 6 | System.out.println("The value of i is: "+i); 7 | } 8 | } 9 | } 10 | 11 | class ForEvenOrOdd 12 | { 13 | public static void main(String args[]) 14 | { 15 | int i,j; 16 | for(i=0;i<=10;i++) 17 | { 18 | if(i%2==1) 19 | { 20 | System.out.println("Odd Numbers:" +i); 21 | } 22 | } 23 | for(j=0;j<10;j++) 24 | { 25 | if(j%2==0) 26 | { 27 | System.out.println("Even Number:"+j); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Loops/For Loop/ForLoopExample2.java: -------------------------------------------------------------------------------- 1 | 2 | // this is used to itterate through the array 3 | 4 | public class ForLoopExample3 { 5 | public static void main(String args[]){ 6 | int arr[]={9,3,4,1,10,24}; 7 | for(int i=0; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Loops/For Loop/src/ForLoopExample.java: -------------------------------------------------------------------------------- 1 | public class ForLoopExample { 2 | public static void main(String[] args) { 3 | for(int i=1;i<=10;i++){ 4 | System.out.println(i); 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Loops/NestedLoop.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | class NestedLoop { 3 | 4 | public static void main(String[] args) { 5 | 6 | Scanner sc = new Scanner(System.in); 7 | System.out.print("Enter the number of Rows you wants to build : "); 8 | int row = sc.nextInt(); 9 | System.out.print("Enter the number of Columns you wants to build : "); 10 | int column = sc.nextInt(); 11 | System.out.print("Enter the character you want to print : "); 12 | char character = sc.next().charAt(0); 13 | 14 | myFunction(row, column, character); 15 | 16 | } 17 | 18 | 19 | public static void myFunction(int row, int column, char character){ 20 | 21 | for(int a = 0; a < row;a++){ 22 | for(int b = 0; b < column;b++){ 23 | System.out.print(character + " "); 24 | } 25 | System.out.println(); 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /Loops/NumberPattern.java: -------------------------------------------------------------------------------- 1 | 2 | public class NumberPattern { 3 | 4 | public static void main(String[] args) 5 | { 6 | 7 | int n = 5; 8 | 9 | for (int i = 1; i <= n; i++) 10 | { 11 | for (int j = 1; j < i; j++) 12 | { 13 | System.out.print(" "); 14 | } 15 | 16 | for (int k = i; k <= n; k++) 17 | { 18 | System.out.print(k+" "); 19 | } 20 | System.out.println(); 21 | } 22 | for (int i = n-1; i >= 1; i--) 23 | { 24 | for (int j = 1; j < i; j++) 25 | { 26 | System.out.print(" "); 27 | } 28 | for (int k = i; k <= n; k++) 29 | { 30 | System.out.print(k+" "); 31 | } 32 | 33 | System.out.println(); 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Loops/While Loop/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /Loops/While Loop/.idea/.name: -------------------------------------------------------------------------------- 1 | While Loop -------------------------------------------------------------------------------- /Loops/While Loop/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /Loops/While Loop/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Loops/While Loop/.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Loops/While Loop/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Loops/While Loop/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Loops/While Loop/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Loops/While Loop/While Loop.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Loops/While Loop/fact_while: -------------------------------------------------------------------------------- 1 | class Factrl 2 | { 3 | public static void main(String arg[]) 4 | 5 | { 6 | 7 | long n,fact=1; 8 | 9 | Scanner sc=new Scanner(System.in); 10 | 11 | System.out.println("enter number"); 12 | 13 | n=sc.nextLong(); 14 | int i=1; 15 | while(i<=n) 16 | { 17 | 18 | fact=fact*i; 19 | i++; 20 | } 21 | 22 | System.out.println("fact="+fact); 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Loops/While Loop/out/production/While Loop/WhileLoopExample.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Loops/While Loop/out/production/While Loop/WhileLoopExample.class -------------------------------------------------------------------------------- /Loops/While Loop/src/WhileLoopExample.java: -------------------------------------------------------------------------------- 1 | public class WhileLoopExample { 2 | public static void main(String[] args) { 3 | int i=1; 4 | while(i<=10){ 5 | System.out.println(i); 6 | i++; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Loops/WhileLoop.java: -------------------------------------------------------------------------------- 1 | class WhileLoop{ 2 | public static void main(String[] args){ 3 | // Print Numbers from 1 to 10 4 | int i=1; 5 | while(i<=10){ 6 | System.out.println(i); 7 | i++; 8 | } 9 | 10 | // Find Even Numbers between 0 to 20 11 | int j=0; 12 | while(j<=20){ 13 | if(j%2==0) 14 | System.out.println(j); 15 | j++; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Loops/palindrome.java: -------------------------------------------------------------------------------- 1 | 2 | public class palindrome 3 | { 4 | public static void main(String args[]) 5 | { 6 | int rem,temp=0; 7 | int sum=0; 8 | int i =131; 9 | 10 | 11 | temp=i; 12 | 13 | while(i>0) 14 | { 15 | rem=i%10; 16 | 17 | sum=(sum*10)+rem; 18 | } 19 | if(temp==sum) 20 | { 21 | System.out.println("The Number "+sum+" is Palindrome!"); 22 | } 23 | else 24 | { 25 | System.out.println("The Number "+sum+" is Palindrome!"); 26 | } 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Methods/Java Methods/Simple.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/Java Methods/Simple.class -------------------------------------------------------------------------------- /Methods/Java Methods/Simple.java: -------------------------------------------------------------------------------- 1 | public class Simple { //We will discuss a Simple Java Method in this File. 2 | 3 | public static void print() { //This is a Java method,Which will print "Hello World" on the cmd prompt. 4 | //Note : Keywords used : - 5 | //public : for the public access of method anywhere in this file or Another file. 6 | //static : It is used for a constant variable or a method that is same for every instance of a class. 7 | //void : returns nothing. 8 | System.out.println("Hello World"); 9 | } 10 | 11 | public static void main(String[] args) { 12 | print(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Methods/Methods with Parameters/Intermediate.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/Methods with Parameters/Intermediate.class -------------------------------------------------------------------------------- /Methods/Methods with Parameters/Simple.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/Methods with Parameters/Simple.class -------------------------------------------------------------------------------- /Methods/Methods with Parameters/Simple.java: -------------------------------------------------------------------------------- 1 | public class Simple { //This is the Simple Example of Methods with Parameters. 2 | 3 | public static void rollNumber(int rollNo) 4 | /*This Method takes an integer as a Parameter, 5 | Which can be used anywhere in the braces of this method.*/ 6 | { 7 | //Note : Keywords used : - 8 | //public : for the public access of method anywhere in this file or Another file. 9 | //static : It is used for a constant variable or a method that is same for every instance of a class. 10 | //void : returns nothing. 11 | System.out.println("My Roll number is 18SW" + rollNo); 12 | } 13 | 14 | public static void main(String[] args) { 15 | rollNumber(27); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Methods/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /Methods/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /Methods/build/classes/methods/BeansC.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/BeansC.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/Methods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/Methods.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/Neeeeeew.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/Neeeeeew.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/a.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/a.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/aClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/aClass.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/accesModifier.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/accesModifier.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/accesModifier2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/accesModifier2.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/accesModifier3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/accesModifier3.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/calcu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/calcu.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/deposit.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/deposit.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/get.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/get.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/getSetter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/getSetter.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/height.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/height.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/length.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/length.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/main.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/majd.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/majd.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/objects.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/objects.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/random.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/random.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/sameer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/sameer.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/set.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/set.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/supeR.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/supeR.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/test.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/width.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/width.class -------------------------------------------------------------------------------- /Methods/build/classes/methods/withdraw.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/methods/withdraw.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/Neeeeeew.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/Neeeeeew.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/a.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/a.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/deposit.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/deposit.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/random.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/random.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/sameer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/sameer.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/test.class -------------------------------------------------------------------------------- /Methods/build/classes/neeeeeew/withdraw.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Methods/build/classes/neeeeeew/withdraw.class -------------------------------------------------------------------------------- /Methods/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Methods/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=d8a974e4 2 | build.xml.script.CRC32=98e9473f 3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.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=d8a974e4 7 | nbproject/build-impl.xml.script.CRC32=6197c179 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 9 | -------------------------------------------------------------------------------- /Methods/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\Sameer\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties 3 | -------------------------------------------------------------------------------- /Methods/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Methods/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Methods 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Methods/src/methods/BeansC.java: -------------------------------------------------------------------------------- 1 | package methods; 2 | 3 | import java.util.HashMap; 4 | 5 | public class BeansC { 6 | 7 | public static void main(String[] args) { 8 | HashMap a = new HashMap(); 9 | test t = new test(); 10 | a.put("sam", "khan"); 11 | a.put("majd", "khan"); 12 | a.put("owais", "shaikh"); 13 | a.put("yahyah", "khan"); 14 | // t.setName("kashif"); 15 | // t.setPrice(100); 16 | 17 | // System.out.println(t.getName()); 18 | //System.out.println(t.getPrice()); 19 | System.out.println(a); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Methods/src/methods/Methods.java: -------------------------------------------------------------------------------- 1 | 2 | package methods; 3 | 4 | import java.util.Scanner; 5 | 6 | public class Methods { 7 | public static void main(String[] args) { 8 | Scanner sc=new Scanner (System.in); 9 | System.out.println("Enter first number"); 10 | int e=sc.nextInt(); 11 | System.out.println("Enter Second number"); 12 | int s=sc.nextInt(); 13 | calcu a=new calcu(); 14 | System.out.println(a); 15 | 16 | a.add(e,s); 17 | 18 | a.sub(e,s); 19 | 20 | a.mult(e,s); 21 | 22 | a.divide(e,s); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Methods/src/methods/Neeeeeew.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | import java.util.Scanner; 9 | 10 | /** 11 | * 12 | * @author khan 13 | */ 14 | public class Neeeeeew { 15 | 16 | public static void main(String[] args) { 17 | 18 | int i; 19 | Scanner sc= new Scanner (System.in); 20 | System.out.println("Enter number u want to perform"); 21 | int a =sc.nextInt(); 22 | for( i = 0; i<=10; i++) 23 | 24 | 25 | System.out.println(a +"*"+i+"="+a*i); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Methods/src/methods/aClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class aClass { 13 | int i=10; 14 | public static void main(String[] args) { 15 | new supeR(2); 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Methods/src/methods/accesModifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class accesModifier { 13 | int maxspeed=10; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Methods/src/methods/accesModifier2.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * To change this license header, choose License Headers in Project Properties. 4 | * To change this template file, choose Tools | Templates 5 | * and open the template in the editor. 6 | */ 7 | package methods; 8 | 9 | /** 10 | * 11 | * @author Sameer 12 | */ 13 | public class accesModifier2 extends accesModifier{ 14 | 15 | int maxspeed=120; 16 | public void display() { 17 | 18 | System.out.println("perivious class Maximum Speed " + super.maxspeed); 19 | System.out.println("maximum speed"+maxspeed); 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Methods/src/methods/accesModifier3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class accesModifier3 { 13 | public static void main(String[] args) { 14 | 15 | accesModifier2 s=new accesModifier2(); 16 | s.display(); 17 | 18 | 19 | }} 20 | -------------------------------------------------------------------------------- /Methods/src/methods/calcu.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | public class calcu { 8 | //int a=10; 9 | //int b=5; 10 | public void add(int e, int s){ 11 | System.out.println("Addition is "+(e+s)); 12 | 13 | } 14 | public void sub(int e, int s){ 15 | System.out.println("Subtraction is" +(e-s)); 16 | } 17 | 18 | public void divide(int e, int s){ 19 | System.out.println("Division is" +(e/s)); 20 | 21 | } 22 | 23 | public void mult(int e, int s){ 24 | System.out.println("Multiplication is" +(e*s)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Methods/src/methods/get.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | 9 | 10 | 11 | 12 | /** 13 | * 14 | * @author Sameer 15 | */ 16 | public class get { 17 | 18 | public static void main(String[] args) { 19 | set a=new set(); 20 | a.setEmploye_Whourse(8); 21 | a.setEmploye_id(10); 22 | a.setEmploye_name("Samer"); 23 | a.setEmploye_salary(5000); 24 | System.out.println("employee detail is"); 25 | System.out.println(""+a.getEmploye_name()); 26 | System.out.println(""+a.getEmploye_Whourse()); 27 | System.out.println(""+a.getEmploye_id()); 28 | System.out.println(""+a.getEmploye_salary()); 29 | } 30 | } -------------------------------------------------------------------------------- /Methods/src/methods/height.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | import java.util.Scanner; 9 | 10 | /** 11 | * 12 | * @author Sameer 13 | */ 14 | public class height { 15 | public static void main(String[] args) { 16 | Scanner sc=new Scanner (System.in); 17 | System.out.println("Enter lentgh"); 18 | int a=sc.nextInt(); 19 | System.out.println("Enter height"); 20 | int b=sc.nextInt(); 21 | System.out.println("Enter width"); 22 | int c=sc.nextInt(); 23 | width w=new width(); 24 | w.height(c); 25 | w.lengthh(a); 26 | w.widthh(b); 27 | w.abc(a, b, c); 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /Methods/src/methods/length.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public abstract class length { 13 | public abstract void lengthh (int a); 14 | public abstract void widthh (int b); 15 | public abstract void height (int c); 16 | public abstract void abc (int a,int b, int c); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Methods/src/methods/main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | import java.util.Scanner; 9 | 10 | /** 11 | * 12 | * @author khan 13 | */ 14 | public class main { 15 | public static void main(String[] args) { 16 | Scanner sc =new Scanner (System.in); 17 | majd c =new majd(); 18 | 19 | System.out.println("enter pin"); 20 | int pin=sc.nextInt(); 21 | c.majd(pin); 22 | //c.sam(pin); 23 | }} -------------------------------------------------------------------------------- /Methods/src/methods/majd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author khan 11 | */ 12 | public class majd extends sameer{ 13 | int amount=10000; 14 | public void majd(int pin){ 15 | 16 | 17 | if (pin==456) { 18 | System.out.println("welcome majd"); 19 | System.out.println("your bank balance is "+amount); 20 | } 21 | else { 22 | System.out.println("invalid pin"); 23 | } 24 | 25 | 26 | 27 | }} -------------------------------------------------------------------------------- /Methods/src/methods/random.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | 9 | 10 | /** 11 | * 12 | * @author khan 13 | */ 14 | public class random{ 15 | public static void main(String[] args) { 16 | int max=1000; 17 | int min=1; 18 | System.out.println("your random values between " + min +" to " + max+" is " ); 19 | int ran=(int)(Math.random()* max+min); 20 | System.out.println(ran); 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Methods/src/methods/sameer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author khan 11 | */ 12 | public class sameer { 13 | int amount=7000; 14 | public void sam(int pin){ 15 | 16 | 17 | if (pin==123) { 18 | System.out.println("welcome sameer"); 19 | System.out.println("your bank balance is "+amount); 20 | } 21 | else 22 | {System.out.println("invalid pin");} 23 | 24 | }} -------------------------------------------------------------------------------- /Methods/src/methods/supeR.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class supeR { 13 | private int k; 14 | 15 | public supeR(int k) { 16 | this.k = k; 17 | System.out.println(k); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Methods/src/methods/withdraw.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package methods; 7 | import java.util.Scanner; 8 | 9 | public class withdraw { 10 | void withdraw(int r){ 11 | int i = 5000; 12 | // Scanner sc=new Scanner (System.in); 13 | 14 | System.out.println("Enter amount to withdraw"); 15 | // int a=sc.nextInt(); 16 | 17 | if (r>i) 18 | { 19 | System.out.println("your amount is unsufficiant"); 20 | } 21 | else if (r<=i) 22 | { 23 | int b=r-i; 24 | System.out.println("After withdraw your amount is " + b); 25 | } 26 | else 27 | { 28 | System.out.println("insufficent amount"); 29 | } 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /Operators/Arithmetic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Operators/Arithmetic.class -------------------------------------------------------------------------------- /Operators/Assignment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Operators/Assignment.class -------------------------------------------------------------------------------- /Operators/BitwiseOperator: -------------------------------------------------------------------------------- 1 | class BitwiseOperator 2 | { 3 | public static void main(String args[]) 4 | { 5 | int a=8; 6 | int b=9; 7 | int c=a&b; //And Operator =8 8 | 9 | int d=a|b; //Or Operator =9 10 | 11 | int e=a^b; //Ex or Operator =1 12 | 13 | int f= ~a; //Not Operator =-9 14 | 15 | System.out.println("AND OPERATOR RESULT:"+c); 16 | System.out.println("OR OPERATOR RESULT:"+d); 17 | System.out.println("EX OR OPERATOR RESULT:"+e); 18 | System.out.println("NOT OPERATOR RESULT:"+f); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Operators/Comparison.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Operators/Comparison.class -------------------------------------------------------------------------------- /Operators/RightOrLeftShiftOperator: -------------------------------------------------------------------------------- 1 | class RightOrLeftShiftOperator 2 | { 3 | public static void main(String args[]) 4 | { 5 | int a=12; //00001100 c)//RIGHT SHIFT 6 | int b=a>>4; //00000000=0 7 | 8 | 9 | int c=a<<4; //00001100 //LEFT SHIFT 10 | //11000000=12 11 | 12 | 13 | System.out.println("RIght:" +b); 14 | System.out.println("LEFT:" +c); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Operators/subtract.java: -------------------------------------------------------------------------------- 1 | Java allows for a wide range of arithmetic operations, from the simplest calculation to the most complex algorithm. 2 | In maths, Subtraction is same as addition but the one operand is of negatuve sign. 3 | in java, when there are two operands with a subtract sign, the program will subtract second operand from one. 4 | 5 | class Subtract 6 | public static void main(String[] args){ 7 | int num1,num2,result; 8 | num1=12; 9 | num2=8; 10 | System.out.println("num1=12; num2=8"); 11 | result=num1-num2; 12 | System.out.println("The result after subtraction of these numbers is : "+result); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Patterns and Series in Java/FibonacciSeries.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class FibonacciSeries{ 4 | 5 | static void printSeries(int n){ 6 | int a = 0; 7 | int b = 1; 8 | 9 | for (int i = 1; i <= n; ++i){ 10 | System.out.print(a + " "); 11 | 12 | int sum = a + b; 13 | a = b; 14 | b = sum; 15 | } 16 | } 17 | 18 | public static void main(String[] args){ 19 | // Take no. of terms input from the user 20 | Scanner sc = new Scanner(System.in); 21 | System.out.print("Enter no. of terms: "); 22 | int n = sc.nextInt(); 23 | 24 | printSeries(n); 25 | } 26 | } -------------------------------------------------------------------------------- /Patterns and Series in Java/More Patterns In Java/Pattern_Output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Patterns and Series in Java/More Patterns In Java/Pattern_Output.png -------------------------------------------------------------------------------- /Projects/Calculator/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Calculator/image1.png -------------------------------------------------------------------------------- /Projects/Calculator/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Calculator/image2.png -------------------------------------------------------------------------------- /Projects/JavaFX GUI Calculator (Simple)/Main.java: -------------------------------------------------------------------------------- 1 | package sample; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class Main extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); 14 | primaryStage.setTitle("Simple Java FX Calculator"); 15 | primaryStage.setScene(new Scene(root, 300, 275)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | 21 | 22 | public static void main(String[] args) { 23 | launch(args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Projects/Puzzle Project/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/1.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/10.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/11.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/12.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/13.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/14.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/15.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/2.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/3.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/4.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/5.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/6.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/7.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/8.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/9.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/blank.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/blank.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/f1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/f1.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/main.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Puzzle Project/main.jpg -------------------------------------------------------------------------------- /Projects/Puzzle Project/test1.java: -------------------------------------------------------------------------------- 1 | import java.awt.*; 2 | import javax.swing.*; 3 | import java.awt.event.*; 4 | class test1 implements ActionListener{ 5 | JFrame f1=new JFrame(); 6 | int x=0; 7 | int y=0; 8 | JButton bt1=new JButton(""); 9 | test1(){ 10 | f1.setLayout(null); 11 | f1.setBounds(0,0,361,550); 12 | bt1.setBounds(0,0,120,120); 13 | f1.add(bt1); 14 | bt1.addActionListener(this); 15 | f1.show(); 16 | } 17 | public void actionPerformed(ActionEvent e){ 18 | if(e.getSource()==bt1){ 19 | x=x+20; 20 | y=y+20; 21 | 22 | JButton bt2=new JButton("2"); 23 | bt2.setBounds(x,y,200,200); 24 | f1.add(bt2); 25 | } 26 | } 27 | } 28 | 29 | class test{ 30 | public static void main(String arg[]){ 31 | test1 p=new test1(); 32 | 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Projects/Snake Game/images/downmouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/downmouth.png -------------------------------------------------------------------------------- /Projects/Snake Game/images/enemy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/enemy.png -------------------------------------------------------------------------------- /Projects/Snake Game/images/leftmouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/leftmouth.png -------------------------------------------------------------------------------- /Projects/Snake Game/images/rightmouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/rightmouth.png -------------------------------------------------------------------------------- /Projects/Snake Game/images/snakeimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/snakeimage.png -------------------------------------------------------------------------------- /Projects/Snake Game/images/snaketitle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/snaketitle.jpg -------------------------------------------------------------------------------- /Projects/Snake Game/images/upmouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Snake Game/images/upmouth.png -------------------------------------------------------------------------------- /Projects/Temperature Converter/Output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/Temperature Converter/Output.png -------------------------------------------------------------------------------- /Projects/UtilityProgram/README.md: -------------------------------------------------------------------------------- 1 | //Documentation 2 | 3 | This program is client and server based(NETWORKING) 4 | 5 | 6 | Step: 1 7 | 8 | 9 | first compile all the files by writing this command in CMD 10 | javac *.java 11 | 12 | 13 | Compilation is done and now First Run Server 14 | 15 | Step 2: 16 | 17 | Command for running Server is 18 | java Server.java 19 | 20 | 21 | Step 3: 22 | 23 | after that open other CMD and Run Client 24 | UtilityProgram is CLIENT so running UtilityProgram write this command in CMD 25 | java UtilityProgram.java 26 | 27 | 28 | Step 4: 29 | 30 | and NOW You Will See GUI 31 | so write any IP such as 127.0.0.1 ,choose any option(notepad,calc,mspaint) from list and then click on Action button 32 | this will open your chosen utility in other computer or your local machine thats why this is called utility program 33 | -------------------------------------------------------------------------------- /Projects/UtilityProgram/Server.java: -------------------------------------------------------------------------------- 1 | import java.net.*; 2 | import java.io.*; 3 | public class Server { 4 | 5 | public static void main(String arg[])throws Exception{ 6 | ServerSocket server=new ServerSocket(9090); 7 | do{ 8 | Socket socket=server.accept(); 9 | DataInputStream in=new DataInputStream(socket.getInputStream()); 10 | String cmd=in.readLine(); 11 | Runtime run=Runtime.getRuntime(); 12 | run.exec(cmd); 13 | in.close(); 14 | socket.close(); 15 | }while(true); 16 | 17 | 18 | 19 | } 20 | 21 | 22 | 23 | } 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Wed, 06 Nov 2019 21:49:45 +0500 2 | 3 | 4 | E\:\\Java\ Applications\\VirtualPiano= 5 | -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$1.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$10.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$10.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$11.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$11.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$12.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$12.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$13.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$13.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$14.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$14.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$15.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$15.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$16.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$16.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$17.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$17.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$18.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$18.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$19.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$19.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$2.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$20.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$20.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$3.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$4.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$5.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$6.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$7.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$7.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$8.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$8.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano$9.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano$9.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/build/classes/VirtualPiano.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/build/classes/VirtualPiano.class -------------------------------------------------------------------------------- /Projects/VirtualPiano/dist/VirtualPiano.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/dist/VirtualPiano.jar -------------------------------------------------------------------------------- /Projects/VirtualPiano/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note.zip -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/A.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/A.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/A_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/A_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/B.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/B.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/B_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/B_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Bb.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Bb.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Bb_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Bb_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/C.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/C.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/C1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/C1.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/C1_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/C1_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/C_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/C_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/C_s.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/C_s.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/C_s1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/C_s1.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Cq1_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Cq1_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Cq_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Cq_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/D.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/D.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/D1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/D1.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/D1_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/D1_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/D_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/D_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/D_s.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/D_s.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/D_s1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/D_s1.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Dq1_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Dq1_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Dq_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Dq_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/E.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/E.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/E1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/E1.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/E1_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/E1_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/E_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/E_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/F.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/F.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/F1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/F1.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/F1_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/F1_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/F_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/F_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/F_s.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/F_s.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Fq_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Fq_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/G.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/G.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/G_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/G_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/G_s.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/G_s.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/music notes/Music_Note/Gq_Drum.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/Projects/VirtualPiano/music notes/Music_Note/Gq_Drum.wav -------------------------------------------------------------------------------- /Projects/VirtualPiano/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=f27c6500 2 | build.xml.script.CRC32=79e65afe 3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.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=f27c6500 7 | nbproject/build-impl.xml.script.CRC32=ce354d4f 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 9 | -------------------------------------------------------------------------------- /Projects/VirtualPiano/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\ND.COM\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties 3 | -------------------------------------------------------------------------------- /Projects/VirtualPiano/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Projects/VirtualPiano/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | VirtualPiano 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Python: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RealLifeExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package reallifeecample; 7 | 8 | class Person 9 | { 10 | String name; 11 | int id; 12 | Person (String name, int id) 13 | { 14 | this.id=id; 15 | this.name=name; 16 | } 17 | } 18 | class Emp extends Person 19 | { 20 | double salary; 21 | Emp (String name, int id, double salary) 22 | { 23 | super(name,id); 24 | this.salary=salary; 25 | } 26 | void display() 27 | { 28 | System.out.println("id: "+id+", name: "+name+", salary: "+salary); 29 | } 30 | } 31 | public class RealLifeExample { 32 | static public void main (String[] args) 33 | { 34 | Emp obj=new Emp("Ahsan",26,100000.0); 35 | obj.display(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/FOR/FOR.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/FOR/FOR.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/FOR/Star.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/FOR/Star.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/FOR/Table.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/FOR/Table.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/Truck.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/Truck.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/category/Category.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/category/Category.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/category/SecondCategory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/category/SecondCategory.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/dowhile/DoWhile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/dowhile/DoWhile.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/evenno/EvenNo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/evenno/EvenNo.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/fabuna/Fabuna.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/fabuna/Fabuna.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/findage/Findage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/findage/Findage.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/marksheet/Marksheet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/marksheet/Marksheet.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/pQueue.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/pQueue.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/pkgswitch/Switch.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/pkgswitch/Switch.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/AdCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/AdCalculator.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/BEans1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/BEans1.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/Beans.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/Beans.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/Calculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/Calculator.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/Calculatorsw.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/Calculatorsw.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/DoubletoInt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/DoubletoInt.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/EvenNo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/EvenNo.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/Opp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/Opp.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/SceintficCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/SceintficCalculator.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/StringForm.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/StringForm.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/test.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/sceintficcalculator/test2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/sceintficcalculator/test2.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/stackprogrm.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/stackprogrm.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/submarks/SubMarks.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/submarks/SubMarks.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/switchcalculator/DoubletoInt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/switchcalculator/DoubletoInt.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/switchcalculator/SwitchCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/switchcalculator/SwitchCalculator.class -------------------------------------------------------------------------------- /SceintficCalculator/build/classes/vowels/Vowels.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/SceintficCalculator/build/classes/vowels/Vowels.class -------------------------------------------------------------------------------- /SceintficCalculator/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /SceintficCalculator/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=e8063335 2 | build.xml.script.CRC32=4e612b26 3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.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=e8063335 7 | nbproject/build-impl.xml.script.CRC32=d7e70da0 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 9 | -------------------------------------------------------------------------------- /SceintficCalculator/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\Sameer\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties 3 | -------------------------------------------------------------------------------- /SceintficCalculator/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SceintficCalculator/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | SceintficCalculator 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Beans.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package sceintficcalculator; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class Beans { 11 | String name; 12 | int date; 13 | ArrayList list; 14 | 15 | public Beans(String name, int date, ArrayList List) { 16 | this.name = name; 17 | this.date =date; 18 | } 19 | public String getName(){ 20 | return name; 21 | } 22 | public int getDate(){ 23 | return date; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return "Beans{" + "name=" + name + ", date=" + date + ", list=" + list + '}'; 29 | } 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Calculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package sceintficcalculator; 7 | 8 | import java.util.Scanner; 9 | 10 | public class Calculator { 11 | public static void main(String[] args) { 12 | // TODO code application logic here 13 | System.out.println("Enter first number"); 14 | 15 | Scanner sc=new Scanner(System.in); 16 | int i=sc.nextInt(); 17 | System.out.println("Enter second number"); 18 | int b=sc.nextInt(); 19 | int c=i+b; 20 | System.err.println(c); 21 | int d=i-b; 22 | System.err.println(d); 23 | float e=i/b; 24 | System.err.println(e); 25 | int f=i*b; 26 | System.err.println(f); 27 | 28 | 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Calculatorsw.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package sceintficcalculator; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class Calculatorsw { 13 | 14 | /** 15 | * @param args the command line arguments 16 | */ 17 | public static void main(String[] args) { 18 | // TODO code application logic here 19 | int i=1; 20 | int b=5; 21 | int c=i+b; 22 | int d=i-b; 23 | int e=i/b; 24 | int f=i*b; 25 | System.out.println(c+" " + d +" "+ e +" " + f +" "); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/DoubletoInt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package sceintficcalculator; 7 | 8 | import java.util.Scanner; 9 | 10 | /** 11 | * 12 | * @author Sameer 13 | */ 14 | public class DoubletoInt { 15 | 16 | /** 17 | * @param args the command line arguments 18 | */ 19 | public static void main(String[] args) { 20 | // TODO code application logic here 21 | System.out.println("Enter any value which u want to convert"); 22 | Scanner sc=new Scanner(System.in); 23 | 24 | 25 | double d= sc.nextDouble(); 26 | int s= (int) d; 27 | System.out.println(""+s); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/EvenNo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package sceintficcalculator; 7 | 8 | public class EvenNo { 9 | 10 | public static void main(String[] args) { 11 | for ( int i=0; i<=20; i=i+2) { 12 | 13 | System.out.println("Even numbers " + i); } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/FOR.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package FOR; 7 | 8 | public class FOR { 9 | public static void main (String args[]){ 10 | 11 | for (int i=1; i<=5;i++){ 12 | 13 | for(int j=5; j>=i; j--){ 14 | System.out.print(" ");} 15 | for (int s=1; s<=i; s++){ 16 | System.out.println("*");} 17 | for (int k=2; k<=i; k++){ 18 | System.out.println("*"); 19 | } 20 | System.out.println(" "); 21 | } 22 | 23 | }} -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Fabuna.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package fabuna; 7 | 8 | import java.util.Scanner; 9 | 10 | public class Fabuna { 11 | public static void main(String[] args) { 12 | int t=0; 13 | int s=1; 14 | Scanner sc=new Scanner(System.in); 15 | System.out.println("Enter the Series number"); 16 | int n=sc.nextInt(); 17 | for (int i=0; i=14 && age<=45) 19 | System.out.println("you are young"); 20 | else if (age>=45 && age<=100) 21 | System.out.println("you are old"); 22 | else 23 | System.out.println("Please enter age 1 t0 100"); 24 | } 25 | } -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Star.java: -------------------------------------------------------------------------------- 1 | package FOR; 2 | public class Star { 3 | public static void main(String[] args) { 4 | //First Pattern 5 | for (int i=1; i<=5;i++){ 6 | System.out.println(" "); 7 | for(int j=1; j<=i; j++) 8 | System.out.print("*"); } 9 | 10 | System.out.println(""); 11 | 12 | 13 | for (int i=1; i<5; i++){ 14 | for(int j=5; j>i; j--){ 15 | System.out.print("*"); 16 | 17 | } 18 | System.out.println(""); 19 | } 20 | System.out.println("----------------------"); 21 | 22 | 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Table.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package FOR; 7 | 8 | import java.util.Scanner; 9 | 10 | public class Table { 11 | public static void main (String args[]){ 12 | Scanner sc=new Scanner(System.in); 13 | System.out.println("enter the number"); 14 | int i =sc.nextInt(); 15 | for (int j=1; j<=10; j++){ 16 | System.out.println(i +"*"+j + "=" + i*j ); 17 | } 18 | 19 | 20 | 21 | 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/Vowels.java: -------------------------------------------------------------------------------- 1 | 2 | package vowels; 3 | 4 | import java.util.Scanner; 5 | 6 | public class Vowels { 7 | 8 | 9 | public static void main(String[] args) { 10 | System.out.println("Enter Vowels "); 11 | Scanner sc=new Scanner(System.in); 12 | char b=sc.next().charAt(0); 13 | 14 | switch (b){ 15 | case 'a' : 16 | case 'e': 17 | case 'i': 18 | case 'o': 19 | case 'u': 20 | case 'A' : 21 | case 'E': 22 | case 'I': 23 | case 'O': 24 | case 'U': 25 | System.out.println("This is Vowel"); 26 | break; 27 | default: 28 | System.out.println("This is consonent"); 29 | break; 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /SceintficCalculator/src/sceintficcalculator/test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package sceintficcalculator; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class test { 13 | int i; 14 | String s; 15 | 16 | public static void main(String[] args) { 17 | test t=new test(); 18 | System.out.println(t.i+t.s); 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Search/binarySearch.java: -------------------------------------------------------------------------------- 1 | // binarySearch() in a sorted array. 2 | import java.util.Arrays; 3 | 4 | public class GFG { 5 | public static void main(String[] args) 6 | { 7 | int arr[] = { 10, 20, 15, 22, 35 }; 8 | Arrays.sort(arr); 9 | 10 | int key = 22; 11 | int res = Arrays.binarySearch(arr, key); 12 | if (res >= 0) 13 | System.out.println(key + " found at index = " 14 | + res); 15 | else 16 | System.out.println(key + " Not found"); 17 | 18 | key = 40; 19 | res = Arrays.binarySearch(arr, key); 20 | if (res >= 0) 21 | System.out.println(key + " found at index = " 22 | + res); 23 | else 24 | System.out.println(key + " Not found"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Sorting/InsertSort.java: -------------------------------------------------------------------------------- 1 | public class InsertSort { 2 | public static void main (String [] args) { 3 | int [] array = {45,12,85,32,89,39,69,44,42,1,6,8}; 4 | int temp; 5 | for (int i = 1; i < array.length; i++) { 6 | for (int j = i; j > 0; j--) { 7 | if (array[j] < array [j - 1]) { 8 | temp = array[j]; 9 | array[j] = array[j - 1]; 10 | array[j - 1] = temp; 11 | } 12 | } 13 | } 14 | for (int i = 0; i < array.length; i++) { 15 | System.out.println(array[i]); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sorting/QuickSort__Doubly_Linkedlist.java: -------------------------------------------------------------------------------- 1 | /* A typical recursive implementation of Quicksort for array*/ 2 | 3 | /* This function takes last element as pivot, places the pivot element at its 4 | correct position in sorted array, and places all smaller (smaller than 5 | pivot) to left of pivot and all greater elements to right of pivot */ 6 | int partition (int arr[], int l, int h) 7 | { 8 | int x = arr[h]; 9 | int i = (l - 1); 10 | 11 | 12 | for (int j = l; j <= h- 1; j++) 13 | { 14 | if (arr[j] <= x) 15 | { 16 | i++; 17 | swap (&arr[i], &arr[j]); 18 | } 19 | } 20 | swap (&arr[i + 1], &arr[h]); 21 | return (i + 1); 22 | } 23 | 24 | /* A[] --> Array to be sorted, l --> Starting index, h --> Ending index */ 25 | void quickSort(int A[], int l, int h) 26 | { 27 | if (l < h) 28 | { 29 | int p = partition(A, l, h); /* Partitioning index */ 30 | quickSort(A, l, p - 1); 31 | quickSort(A, p + 1, h); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Sorting/bubbleSort.java: -------------------------------------------------------------------------------- 1 | public static void bubbleSort(int[] a) { 2 | boolean sorted = false; 3 | int temp; 4 | while(!sorted) { 5 | sorted = true; 6 | for (int i = 0; i < array.length - 1; i++) { 7 | if (a[i] > a[i+1]) { 8 | temp = a[i]; 9 | a[i] = a[i+1]; 10 | a[i+1] = temp; 11 | sorted = false; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Sorting/iterative_bubbleSort.java: -------------------------------------------------------------------------------- 1 | // Iterative Bubble Sort 2 | bubbleSort(arr[], n) 3 | { 4 | for (i = 0; i < n-1; i++) 5 | 6 | // Last i elements are already in place 7 | for (j = 0; j arr[j+1]) 8 | swap(arr[j], arr[j+1]); 9 | } 10 | -------------------------------------------------------------------------------- /Sorting/mergeSort.java: -------------------------------------------------------------------------------- 1 | public static void mergeSort(int[] array, int left, int right) { 2 | if (right <= left) return; 3 | int mid = (left+right)/2; 4 | mergeSort(array, left, mid); 5 | mergeSort(array, mid+1, right); 6 | merge(array, left, mid, right); 7 | } 8 | -------------------------------------------------------------------------------- /Sorting/quickSort.java: -------------------------------------------------------------------------------- 1 | static int partition(int[] array, int begin, int end) { 2 | int pivot = end; 3 | 4 | int counter = begin; 5 | for (int i = begin; i < end; i++) { 6 | if (array[i] < array[pivot]) { 7 | int temp = array[counter]; 8 | array[counter] = array[i]; 9 | array[i] = temp; 10 | counter++; 11 | } 12 | } 13 | int temp = array[pivot]; 14 | array[pivot] = array[counter]; 15 | array[counter] = temp; 16 | 17 | return counter; 18 | } 19 | 20 | public static void quickSort(int[] array, int begin, int end) { 21 | if (end <= begin) return; 22 | int pivot = partition(array, begin, end); 23 | quickSort(array, begin, pivot-1); 24 | quickSort(array, pivot+1, end); 25 | } 26 | -------------------------------------------------------------------------------- /Sorting/readme.md: -------------------------------------------------------------------------------- 1 | ## Sorting in Java 2 | You can add all your Sorting Algorithms implemented in Java in this folder 3 | -------------------------------------------------------------------------------- /Sorting/selectionSort.java: -------------------------------------------------------------------------------- 1 | public static void selectionSort(int[] array) { 2 | for (int i = 0; i < array.length; i++) { 3 | int min = array[i]; 4 | int minId = i; 5 | for (int j = i+1; j < array.length; j++) { 6 | if (array[j] < min) { 7 | min = array[j]; 8 | minId = j; 9 | } 10 | } 11 | // swapping 12 | int temp = array[i]; 13 | array[i] = min; 14 | array[minId] = temp; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SuperAndThisKeyword/Animal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package SuperAndThisKeyword; 7 | 8 | /** 9 | * 10 | * @author Saqib Ghouri 11 | */ 12 | public class Animal { 13 | String color="white"; 14 | 15 | } 16 | class Dog extends Animal{ 17 | String color="Black"; 18 | public void printColor(){ 19 | String color="transparent"; 20 | System.out.println(this.color+"\n "+color+"\n"+super.color); 21 | } 22 | } 23 | class PrintColor{ 24 | public static void main(String args[]){ 25 | Dog d=new Dog(); 26 | d.printColor(); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /SuperAndThisKeyword/AnimalParentClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package SuperAndThisKeyword; 7 | 8 | /** 9 | * 10 | * @author Saqib Ghouri 11 | */ 12 | public class AnimalParentClass { 13 | 14 | AnimalParentClass() { 15 | System.out.println("This is animal parent class"); 16 | } 17 | 18 | 19 | } 20 | class ChildAnimal extends AnimalParentClass{ 21 | 22 | ChildAnimal() { 23 | super(); 24 | 25 | } 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /SuperAndThisKeyword/RealUse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package SuperAndThisKeyword; 7 | 8 | /** 9 | * 10 | * @author Saqib Ghouri 11 | */ 12 | public class RealUse { 13 | String name; 14 | String rollno; 15 | String price; 16 | RealUse(String name,String rollno,String price){ 17 | this.name=name; 18 | this.rollno=rollno; 19 | this.price=price; 20 | } 21 | } 22 | class ChildRealUse extends RealUse{ 23 | public ChildRealUse(String name, String rollno, String price) { 24 | 25 | super(name, rollno, price); 26 | 27 | 28 | } 29 | void display(){ 30 | System.out.println(name+" "+rollno+" "+price+" "); 31 | } 32 | 33 | } 34 | class PrintDis{ 35 | public static void main(String args[]){ 36 | ChildRealUse c=new ChildRealUse("Saqib","f16cs08", "600"); 37 | c.display(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /SuperAndThisKeyword/SuperClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package SuperAndThisKeyword; 7 | 8 | /** 9 | * 10 | * @author Saqib Ghouri 11 | */ 12 | public class SuperClass { 13 | public void eat(){ 14 | System.out.println("let eat as parent"); 15 | } 16 | 17 | } 18 | class ChildClass extends SuperClass 19 | { 20 | public void eat(){ 21 | System.out.println("Let's eat as child"); 22 | super.eat(); 23 | } 24 | 25 | } 26 | class Test{ 27 | public static void main(String args[]){ 28 | ChildClass cl=new ChildClass(); 29 | cl.eat(); 30 | 31 | 32 | } 33 | } -------------------------------------------------------------------------------- /Thread/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../:\hacktoberfestProject\Thread\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /Thread/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Thread/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Thread/Thread.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Thread/src/ConcurrencyHandlingDemo.java: -------------------------------------------------------------------------------- 1 | public class ConcurrencyHandlingDemo extends Thread{ 2 | 3 | private static int sharedResource = 0; 4 | 5 | public static void main(String[] args) { 6 | ConcurrencyHandlingDemo thread = new ConcurrencyHandlingDemo(); 7 | thread.start(); 8 | while(thread.isAlive()) { 9 | System.out.println("Thread is not finished yet"); 10 | } 11 | System.out.println(sharedResource); 12 | sharedResource++; 13 | System.out.println(sharedResource); 14 | } 15 | 16 | public void run() { 17 | sharedResource++; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Thread/src/FirstThread.java: -------------------------------------------------------------------------------- 1 | public class FirstThread extends Thread { 2 | public void run() { 3 | System.out.println("first thread is executing."); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Thread/src/SecondThread.java: -------------------------------------------------------------------------------- 1 | public class SecondThread implements Runnable{ 2 | @Override 3 | public void run() { 4 | System.out.println("second thread is executing."); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Thread/src/ThreadDemo.java: -------------------------------------------------------------------------------- 1 | public class ThreadDemo { 2 | 3 | public static void main(String[] args) { 4 | FirstThread firstThread = new FirstThread(); 5 | firstThread.start(); 6 | 7 | SecondThread secondThread = new SecondThread(); 8 | Thread thread = new Thread(secondThread); 9 | thread.start(); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /TicTacToe/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /TicTacToe/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /TicTacToe/build/classes/java_tictactoe_game/TicTacToe_Game$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/java_tictactoe_game/TicTacToe_Game$1.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/java_tictactoe_game/TicTacToe_Game$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/java_tictactoe_game/TicTacToe_Game$2.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/java_tictactoe_game/TicTacToe_Game$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/java_tictactoe_game/TicTacToe_Game$3.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/tictactoe/TicTacToe_Game$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/tictactoe/TicTacToe_Game$1.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/tictactoe/TicTacToe_Game$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/tictactoe/TicTacToe_Game$2.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/tictactoe/TicTacToe_Game$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/tictactoe/TicTacToe_Game$3.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/tictactoe/TicTacToe_Game$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/tictactoe/TicTacToe_Game$4.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/tictactoe/TicTacToe_Game$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/tictactoe/TicTacToe_Game$5.class -------------------------------------------------------------------------------- /TicTacToe/build/classes/tictactoe/TicTacToe_Game.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/TicTacToe/build/classes/tictactoe/TicTacToe_Game.class -------------------------------------------------------------------------------- /TicTacToe/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /TicTacToe/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=a6d54361 2 | build.xml.script.CRC32=f7058ad1 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.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=a6d54361 7 | nbproject/build-impl.xml.script.CRC32=69ad137b 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /TicTacToe/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\Sameer\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties 3 | -------------------------------------------------------------------------------- /TicTacToe/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TicTacToe/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Java_TicTacToe_Game 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /defaultAccessModifier/DefaultAccessModifier.java: -------------------------------------------------------------------------------- 1 | package defaultAccessModifier; 2 | 3 | public class DefaultAccessModifier { 4 | void defaultMethod() { 5 | 6 | System.out.println("Hello"); 7 | } 8 | 9 | public int defaultMethod(int a) { 10 | return a; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hashMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package arrayprog; 7 | 8 | import java.util.HashMap; 9 | 10 | /** 11 | * 12 | * @author Sameer 13 | */ 14 | public class hashmap { 15 | public static void main(String[] args) { 16 | 17 | HashMap name = new HashMap(); 18 | 19 | 20 | name.put("Sameer ", " khan"); 21 | name.put("majd", "odeh"); 22 | name.put("asif", "shaikh"); 23 | name.put("kashif", "rajput"); 24 | System.out.println(name); 25 | } 26 | } 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /interface/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /interface/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/A.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/A.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/B.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/B.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/NewInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/NewInterface.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/areaMathmain.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/areaMathmain.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/areaVolume.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/areaVolume.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/c.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/c.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/interfac.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/interfac.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/main.class -------------------------------------------------------------------------------- /interface/build/classes/pkginterface/mathfun.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSA-Mehran-UET/Learn-to-code-java/3d34e123179d47a1aee95b3e3003ba4f5e234b1f/interface/build/classes/pkginterface/mathfun.class -------------------------------------------------------------------------------- /interface/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /interface/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=3edd2e96 2 | build.xml.script.CRC32=c7caee37 3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.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=3edd2e96 7 | nbproject/build-impl.xml.script.CRC32=8df0be03 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 9 | -------------------------------------------------------------------------------- /interface/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\Sameer\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties 3 | -------------------------------------------------------------------------------- /interface/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /interface/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | interface 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /interface/src/pkginterface/A.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pkginterface; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class A { 13 | int length,width, height; 14 | void area(){ 15 | 16 | int l=length*width; 17 | System.out.println("your area is"+l); 18 | } 19 | void volume(){ 20 | int l=length*width; 21 | System.out.println("your area is"+l); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /interface/src/pkginterface/B.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pkginterface; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class B { 13 | int a; 14 | void sin(){ 15 | System.out.println("your sin value is"+Math.sin(a)); 16 | } 17 | void cos(){ 18 | System.out.println("your cos value is"+Math.cos(a)); 19 | } 20 | void tan(){ 21 | System.out.println("your tan value is"+Math.tan(a)); 22 | } 23 | void sqr(){ 24 | System.out.println("your tan value is"+Math.sqrt(a)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /interface/src/pkginterface/NewInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pkginterface; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public interface NewInterface { 13 | public void sin(int a); 14 | public void cos(int b); 15 | public void tan(int c); 16 | public void sqrt(int d); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /interface/src/pkginterface/areaVolume.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pkginterface; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public interface areaVolume { 13 | void area(int length, int width); 14 | void vol(int length, int width,int height); 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /interface/src/pkginterface/c.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pkginterface; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public class c extends A,B{ 13 | 14 | } 15 | -------------------------------------------------------------------------------- /interface/src/pkginterface/mathfun.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pkginterface; 7 | 8 | /** 9 | * 10 | * @author Sameer 11 | */ 12 | public interface mathfun { 13 | void add(int a,int b); 14 | void sub(int a, int b); 15 | void multi(int a, int b); 16 | void div(int a, int b); 17 | } 18 | -------------------------------------------------------------------------------- /palindrome: -------------------------------------------------------------------------------- 1 | 2 | public class palindrome 3 | { 4 | public static void main(String args[]) 5 | { 6 | int rem,temp=0; 7 | int sum=0; 8 | int i =131; 9 | 10 | 11 | temp=i; 12 | 13 | while(i>0) 14 | { 15 | rem=i%10; 16 | 17 | sum=(sum*10)+rem; 18 | } 19 | if(temp==sum) 20 | { 21 | System.out.println("The Number "+sum+" is Palindrome!"); 22 | } 23 | else 24 | { 25 | System.out.println("The Number "+sum+" is Palindrome!"); 26 | } 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /readme_for_tictactoe.md: -------------------------------------------------------------------------------- 1 | I made this projrct when i was learning java. 2 | contains very basic stuff like loops, conditionals statements and switch statements. 3 | 4 | 5 | -Muazzy. 6 | --------------------------------------------------------------------------------