├── .gif ├── EasyKtuMath.gif └── S3CsSgpa.gif ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── 2darray ├── MatrixAddUI.java └── MatrixMult.java ├── Abstract Keyword ├── AbstractAreas.java ├── AbstractExample.java └── README.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Data Types And Operators ├── ArithmeticOperators.java ├── AssignmentOperators.java ├── BitwiseOperators.java ├── CommonDataTypes.java ├── ConditionalOperators.java ├── OnePlusTwoEqualsTwelve.java ├── README.md ├── RelationalOperators.java ├── TypeComparisonOperators.java ├── UnaryOperators.java └── UnderstandingTypeCasting.java ├── EasyKtuMath ├── Main.java ├── NumericIntegration.java └── RecursiveParser.java ├── EventHandling ├── LoginGUI.java ├── sum_2nos.html └── sum_2nos.java ├── JDBCTemplate ├── JdbcBeg.java └── README.md ├── LICENSE ├── Loops ├── Foreach.java ├── forloop.java ├── ifelse.java └── quadraticseries.java ├── Misc └── strings.java ├── Overloading and Overriding ├── csb.java ├── jumpstatements.java ├── objectequality.java ├── overriding.java ├── reference.java └── superclass.java ├── README.md ├── S3CsSgpa ├── CheckSgpa.java ├── reg.txt └── sgpa.txt ├── Threads ├── BasicThreadsByExtending.java ├── BasicThreadsByMainOnly.java ├── BasicThreadsByRunnable.java ├── BasicThreadsBySync.java ├── MaxValue.java ├── README.md ├── ReverseHello.java └── SharedCounter.java └── tags /.gif/EasyKtuMath.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yedhink/KTU-Java/7c89b66362aec575efde46d0f75266b78635e99d/.gif/EasyKtuMath.gif -------------------------------------------------------------------------------- /.gif/S3CsSgpa.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yedhink/KTU-Java/7c89b66362aec575efde46d0f75266b78635e99d/.gif/S3CsSgpa.gif -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **IMPORTANT: Please refer to the** [Contribution Guidelines](https://github.com/yedhink/KTU-Java/blob/master/CONTRIBUTING.md) **before making a pull request.** 2 | 3 | *Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.* 4 | 5 | Please provide enough information so that others can review your pull request: 6 | 7 | 8 | 9 | Explain the **details** for making this change. What existing problem does the pull request solve? 10 | 11 | 12 | 13 | **Code formatting** 14 | 15 | Refer to code formatting in [Contribution guidelines](https://github.com/yedhink/KTU-Java/blob/master/CONTRIBUTING.md) 16 | 17 | **Closing issues** 18 | 19 | Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /2darray/MatrixAddUI.java: -------------------------------------------------------------------------------- 1 | package twoDArray; 2 | import java.util.Scanner; 3 | class MatrixAddUI{ 4 | public static void main(String args[]){ 5 | int Mat1[][]=new int[10][10]; 6 | int Mat2[][]=new int[10][10]; 7 | int res[][]=new int[10][10]; 8 | int i=0 , j=0 ; 9 | Scanner Cin = new Scanner(System.in); 10 | System.out.printf("Enter the number of rows = "); 11 | int r = Cin.nextInt(); 12 | System.out.printf("Enter the number of coloumn = "); 13 | int c = Cin.nextInt(); 14 | 15 | System.out.println("Enter First Matrix: "); 16 | for(i=0;i. Feel free to create a github issue if 29 | documentation is missing, incomplete or outdated. 30 | 31 | ## Questions 32 | 33 | There are various channels, on which you can ask questions: 34 | 35 | * The mailing list: yedhin1998@gmail.com 36 | 37 | * PM in Linkedin : https://www.linkedin.com/in/yedhin1998 38 | 39 | ## Code Style 40 | 41 | Refer to this [Code Convetion](http://www.oracle.com/technetwork/java/codeconvtoc-136057.html) while writing your source files. 42 | -------------------------------------------------------------------------------- /Data Types And Operators/ArithmeticOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class ArithmeticOperators { 3 | public static void main(String[] args) { 4 | int x = 10; 5 | int y = 20; 6 | int result = x + y; 7 | 8 | System.out.println("x ="+ x +"\ny = " + y); 9 | System.out.println("x + y = " + result); 10 | 11 | result = x - y; 12 | 13 | System.out.println("x - y = " + result); 14 | 15 | result = x * y; 16 | 17 | System.out.println("x * y = " + result); 18 | 19 | result = y / x; 20 | 21 | System.out.println("y / x = " + result); 22 | 23 | result = x % 3; 24 | 25 | System.out.println("x % 3 = " + result); 26 | 27 | String greeting = "\"+\" operator can be " + "used to concatanate strings"; 28 | System.out.println(greeting); 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Data Types And Operators/AssignmentOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class AssignmentOperators { 3 | public static void main(String[] args) { 4 | 5 | /* 6 | * For Integer literals (int, long), the default is int. For obvious reasons. 7 | * For Floating point literals (float, double) the default is double. Because using double potentially allows safer arithmetic on the stored values. 8 | * So, when you type 12 in your program, thats an int literal, as opposed to 12L, which is a long. And when you type 12.3, thats a double literal, as opposed to 12.3F, which is a float. 9 | */ 10 | 11 | int x = 10; 12 | float y = 3.5F; 13 | String value = "Led Zeppelin FTW"; 14 | System.out.println("x = "+x+"\ny = "+y+"\nvalue = "+value); 15 | 16 | /* Assigning int with float value. Is this possible? uncomment to see 17 | x = 1.2232; 18 | System.out.println("\nAfter assigning int x with a float value, x = "+x); 19 | */ 20 | 21 | // Basic arithemetic 22 | x = 5/2; 23 | System.out.println("\nAfter assigning int x with result of 5/2, x = "+x); 24 | 25 | x = 5/2; 26 | System.out.println("\nAfter assigning int x with result of 5/2 and printing type casted value, (float)x = "+(float)x); 27 | 28 | y = 5/2; 29 | System.out.println("\nAfter assigning float y with result of 5/2, y = "+y); 30 | 31 | y = 5/2; 32 | System.out.println("\nAfter assigning float y with result of 5/2 and printing type casted value, (int)y = "+(int)y); 33 | 34 | /* is this possible? uncomment to see 35 | y = 5.0/2.0; 36 | System.out.printf("\nAfter assigning float y with result of 5.0/2.0, y = "+y); 37 | */ 38 | 39 | y = 5.0F/2.0F; 40 | System.out.println("\nAfter assigning float y with result of 5.0F/2.0F, y = "+y); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Data Types And Operators/BitwiseOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class BitwiseOperators { 3 | public static void main(String args[]) { 4 | int a = 60; /* 60 = 0011 1100 */ 5 | int b = 13; /* 13 = 0000 1101 */ 6 | int c = 0; 7 | 8 | System.out.println("a ="+ a +"\nb = " + b+"\nc = "+c); 9 | c = a & b; /* 12 = 0000 1100 */ 10 | System.out.println("a & b = " + c ); 11 | 12 | c = a | b; /* 61 = 0011 1101 */ 13 | System.out.println("a | b = " + c ); 14 | 15 | c = a ^ b; /* 49 = 0011 0001 */ 16 | System.out.println("a ^ b = " + c ); 17 | 18 | c = ~a; /*-61 = 1100 0011 */ 19 | System.out.println("~a = " + c ); 20 | 21 | c = a << 2; /* 240 = 1111 0000 */ 22 | System.out.println("a << 2 = " + c ); 23 | 24 | c = a >> 2; /* 15 = 1111 */ 25 | System.out.println("a >> 2 = " + c ); 26 | 27 | c = a >>> 2; /* 15 = 0000 1111 */ 28 | System.out.println("a >>> 2 = " + c ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Data Types And Operators/CommonDataTypes.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class CommonDataTypes { 3 | /** 4 | * This program demonstrates common variable type usage and 5 | * how to format output of variables. 6 | */ 7 | public static void main(String[] args) { 8 | String studentName = "Bette Itall"; 9 | int age = 22; 10 | double gpa = 3.75; 11 | boolean isFemale = true; 12 | System.out.printf("%s is %d years old. %s has a %4.3f gpa.\n", 13 | studentName, 14 | age, 15 | (isFemale ? "She" : "He"), 16 | gpa); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Data Types And Operators/ConditionalOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class ConditionalOperators { 3 | public static void main(String[] args) { 4 | int x = 10; 5 | int y = 20; 6 | 7 | System.out.println("x ="+ x +"\ny = " + y); 8 | if ((x > 8) && (y > 8)) { 9 | System.out.println("Both x and y are greater than 8"); 10 | } 11 | 12 | if ((x > 10) || (y > 10)) { 13 | System.out.println("Either x or y is greater than 10"); 14 | } 15 | 16 | int result = (x > 10) ? x : y; 17 | 18 | System.out.println("result 1 is: " + result); 19 | 20 | result = (y > 10) ? x : y; 21 | 22 | System.out.println("result 2 is: " + result); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Data Types And Operators/OnePlusTwoEqualsTwelve.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | 3 | import java.util.Scanner; 4 | 5 | public class OnePlusTwoEqualsTwelve { 6 | 7 | public static void main(String[] args) { 8 | // 1 + 2 equals 12? Whaaaaaaaaaaaaat??!?!?!? 9 | String x = "1"; 10 | String y = "2"; 11 | System.out.println(x + y); // not what you expect; 12 | 13 | String first = "Jimmy "; 14 | String last = "Page"; 15 | System.out.println(first + last ); 16 | 17 | // so, how does one to convert string to int? 18 | int i = Integer.parseInt(x); 19 | int j = Integer.parseInt(y); 20 | 21 | System.out.println(i + j); 22 | 23 | // What about booleans? 24 | String areYouHappy = "true"; 25 | boolean ishappy = Boolean.parseBoolean(areYouHappy); 26 | System.out.println(ishappy); 27 | 28 | // Or String to double? 29 | String gpa = "3.96"; 30 | Double realgpa = Double.parseDouble(gpa); 31 | System.out.println(realgpa - 1.0 ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Data Types And Operators/README.md: -------------------------------------------------------------------------------- 1 | ## Primitive Data Types 2 | Check out this [link](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html) to learn in detail about basic data types. 3 | 4 | ## The Java programming language has around 30 operators as summarized below: 5 | ``` 6 | Simple assignment 7 | = 8 | 9 | Arithmetic 10 | + - * / % 11 | 12 | Unary 13 | + - ++ -- ! 14 | 15 | Relational 16 | == != > >= < <= 17 | 18 | Conditional 19 | && || ? : (ternary) 20 | 21 | Type comparison 22 | instanceof 23 | 24 | Bitwise and Bit shift 25 | ~ << >> >>> & ^ | 26 | ``` 27 | -------------------------------------------------------------------------------- /Data Types And Operators/RelationalOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class RelationalOperators { 3 | public static void main(String[] args) { 4 | int x = 10; 5 | int y = 20; 6 | 7 | boolean result = x == y; 8 | 9 | System.out.println("x ="+ x +"\ny = " + y); 10 | System.out.println("x == y? " + result); 11 | 12 | result = x != y; 13 | 14 | System.out.println("x != y? " + result); 15 | 16 | result = x > y; 17 | 18 | System.out.println("x > y? " + result); 19 | 20 | result = x >= y; 21 | 22 | System.out.println("x >= y? " + result); 23 | 24 | result = x < y; 25 | 26 | System.out.println("x < y? " + result); 27 | 28 | result = x <= y; 29 | 30 | System.out.println("x <= y? " + result); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Data Types And Operators/TypeComparisonOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class TypeComparisonOperators { 3 | public static void main(String[] args) { 4 | String name = "Java"; 5 | 6 | if (name instanceof String) { 7 | System.out.println("an instance of String class"); 8 | } 9 | 10 | // test for subclass of Object 11 | if (name instanceof Object) { 12 | System.out.println("an instance of Object class"); 13 | } 14 | 15 | // test for subclass of an interface 16 | if (name instanceof CharSequence) { 17 | System.out.println("an instance of CharSequence interface"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Data Types And Operators/UnaryOperators.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | public class UnaryOperators { 3 | public static void main(String[] args) { 4 | int x = 10; 5 | int y = 20; 6 | 7 | int result = +x; 8 | System.out.println("x ="+ x +"\ny = " + y); 9 | 10 | System.out.println("+x = " + result); 11 | 12 | result = -y; 13 | 14 | System.out.println("-y = " + result); 15 | 16 | result = ++x; 17 | 18 | System.out.println("++x = " + result); 19 | 20 | result = --y; 21 | 22 | System.out.println("--y = " + result); 23 | 24 | boolean ok = false; 25 | 26 | System.out.println("intially ok = false\nok = "+ok); 27 | 28 | System.out.println("!ok = "+!ok); 29 | 30 | System.out.println("++x = "+ (++x)); 31 | 32 | System.out.println("x++ = " + (x++)); 33 | 34 | System.out.println("x = "+x); 35 | 36 | System.out.println("--y = "+ (--y)); 37 | 38 | System.out.println("y-- = "+ (y--)); 39 | 40 | System.out.println("y = "+y); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Data Types And Operators/UnderstandingTypeCasting.java: -------------------------------------------------------------------------------- 1 | package operators; 2 | 3 | public class UnderstandingTypeCasting { 4 | 5 | public static void main(String[] args) { 6 | // This demo will help explain type casting. 7 | int x = 20; 8 | int y = 15; 9 | int i = x / y; // int / int == int 10 | double d1 = x / y; // int / int == int then cast to double 11 | // implicit type cast 12 | double d2 = x / (y * 1.0); // int * double == double; int / double = double 13 | // explicit type cast 14 | double d3 = x / (double)y; // int / double = double 15 | 16 | System.out.println(i); 17 | System.out.println(d1); 18 | System.out.println(d2); 19 | System.out.println(d3); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyKtuMath/Main.java: -------------------------------------------------------------------------------- 1 | package math.modulesix; 2 | import math.modulesix.NumericIntegration; 3 | import java.io.*; 4 | import java.lang.*; 5 | public class Main { 6 | public static void main(String[] args) throws IOException{ 7 | // create character stream object 8 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 9 | int choice; 10 | String proceed = "n"; 11 | 12 | // Enter which Method of Integration you want 13 | do{ 14 | System.out.println("1)Trapezoidal Integration\n2)Simpsons Integration"); 15 | System.out.print("Enter choice = "); 16 | choice = Integer.parseInt(br.readLine()); 17 | switch(choice){ 18 | case 1: NumericIntegration.trapezoidalIntegration();break; 19 | case 2: NumericIntegration.simpsonsIntegration();break; 20 | } 21 | System.out.print("Continue?(y/n) :- "); 22 | }while(br.readLine().equalsIgnoreCase("y")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /EasyKtuMath/NumericIntegration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @name Numeric Intergrations 3 | * @package MATH.modulesix 4 | * @file NumericIntegration.java 5 | * @author Yedhin Kizhakkethara 6 | * @email yedhin1998@gmail.com 7 | * @link https://github.com/yedhink/KTU-Java 8 | * @copyright Copyright (c) 2018 ikigai, All Rights Reserved. 9 | * @license MIT 10 | * @create 23-04-2018 11 | */ 12 | package math.modulesix; 13 | import math.modulesix.RecursiveParser; 14 | import java.lang.*; 15 | import java.io.*; 16 | import java.util.*; 17 | /* 18 | * Operators currently usable:- 19 | * 1) + 20 | * 2) - 21 | * 3) * 22 | * 4) / 23 | * 5) ^(raise to or power function) 24 | * 6) sqrt(value) , eg:- sqrt(2) 25 | * 7) sin(), cos(), tan() 26 | * 8) e , exponential eg:- e^(x^2) :- e raise to x square 27 | * 8) ( and ) for precedence 28 | * 29 | * Input Format for f(x) , an example:- 30 | * Enter f(x) = 1/(1+x^2) 31 | * 32 | * 33 | * 34 | * TRAPEZOIDAL METHOD:- 35 | * a 36 | * (f(x)dx = h/2 [ (f(x)+f(xn)) + 2 * (f(x1)+f(x2)+f(x3)+...f(x[n-1])) ] 37 | * ) 38 | * b 39 | * exmaple:- 40 | * x : 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 41 | * f(x): ? ? ? ? ? ? ? ? ? ? ? 42 | * if x is given like above in question then choose first value as a and lastvalue as b 43 | * i.e :- a=x0 and b=xn 44 | * then either h or n will be given in question. 45 | * h = (b-a)/n , where n = count(x) 46 | * 47 | * SIMPSONS METHOD:- 48 | * a 49 | * (f(x)dx = h/3 [ (f(x)+f(xn)) + 4 * (f(x1)+f(x3)+f(x5)+...f(x[n-1])) + 2 * (f(x2)+f(x4)+f(x6)+...f(x[n-2])) ] 50 | * ) 51 | * b 52 | * exmaple:- 53 | * x : 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 54 | * f(x): ? ? ? ? ? ? ? ? ? ? ? 55 | * if x is given like above in question then choose first value as a and lastvalue as b 56 | * i.e :- a=x0 and b=xn 57 | * then either h or n will be given in question. 58 | * h = (b-a)/n , where n = count(x) 59 | */ 60 | public class NumericIntegration { 61 | private static float a,b,n; 62 | private static String formule , eachFOfX, choice; 63 | private static List valueOfX; 64 | private static List listFOfX; 65 | private static double secondExp , firstPlusLast , thirdExp , evaluated; 66 | private static float h; 67 | private static int i = 0; 68 | private static boolean debug; 69 | private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 70 | 71 | public static void trapezoidalIntegration() throws IOException { 72 | secondExp = 0.0000 ; firstPlusLast= 0.0000 ; thirdExp= 0.0000; evaluated= 0.0000; 73 | debug = false; 74 | System.out.print("Enter f(x) = "); 75 | formule = br.readLine(); 76 | System.out.print("Enter a = "); 77 | a = Float.parseFloat(br.readLine()); // readline() returns String by default 78 | System.out.print("Enter b = "); 79 | b = Float.parseFloat(br.readLine()); 80 | System.out.print("Is the value of n given?(y/n) :- "); 81 | choice = br.readLine(); 82 | if(choice.equalsIgnoreCase("y")){ 83 | System.out.print("Enter n = "); 84 | n = Float.parseFloat(br.readLine()); 85 | h = (b-a)/n; 86 | } 87 | else{ 88 | System.out.print("Enter h = "); 89 | h = Float.parseFloat(br.readLine()); 90 | n = (b-a)/h; 91 | } 92 | 93 | System.out.print("1) I want all steps to be shown in output\n2) I only want final integral value\nChoice = "); 94 | if(br.readLine().equals("1")){ 95 | debug = true; 96 | } 97 | 98 | valueOfX = new ArrayList(); 99 | 100 | // add values of x from x0 to xn to a List 101 | for (i=0;i<=(int)(n);i++) { 102 | valueOfX.add(String.format("%s",a+(i*h))); 103 | } 104 | 105 | // convert list to array of String[] 106 | String[] list = new String[valueOfX.size()]; 107 | valueOfX.toArray(list); 108 | 109 | // store f(x) 110 | eachFOfX = formule; 111 | if(debug){ 112 | listFOfX = new ArrayList(); 113 | System.out.printf("a : %f\nb : %f\nn : %f\nh : %f\nx : ",a,b,n,h); 114 | } 115 | 116 | // iterate through each value of X 117 | for(String eachXValue : valueOfX) { 118 | if(debug) System.out.print(eachXValue+" "); 119 | 120 | // replace exponential e with its value 121 | eachFOfX = eachFOfX.replace("e",String.valueOf("2.71828")); 122 | 123 | eachFOfX = eachFOfX.replace("x",String.valueOf(eachXValue)); 124 | evaluated = (double)RecursiveParser.eval(eachFOfX); 125 | if(debug) listFOfX.add(String.valueOf(evaluated)); 126 | 127 | // create ( f(x1)+f(x2)+f(x3)+...f(x[n-1]) ) 128 | if (!eachXValue.equals(String.valueOf(a)) && !eachXValue.equals(String.valueOf(b)) ){ 129 | secondExp = secondExp + evaluated; 130 | } 131 | // create ( f(x0) + f(xn) ) 132 | else{ 133 | firstPlusLast = firstPlusLast + evaluated; 134 | } 135 | // restore value of f(x) to orginal formula after replacing 136 | eachFOfX = formule; 137 | } 138 | if(debug){ 139 | list = new String[listFOfX.size()]; 140 | listFOfX.toArray(list); 141 | System.out.print("\nf(x) : "); 142 | for ( String fx : listFOfX){ 143 | System.out.printf("%s ", fx); 144 | } 145 | System.out.printf("\nh/2 : %f\nf(x0) + f(xn) : %f\nf(x1)+f(x2)+f(x3)+...f(x[n-1] : %f\n",(h/2),firstPlusLast,secondExp); 146 | } 147 | double finalTrapezoidalIntergralValue = h/2*(firstPlusLast + (2 * secondExp)); 148 | System.out.println("Final answer: "+finalTrapezoidalIntergralValue); 149 | } 150 | public static void simpsonsIntegration() throws IOException { 151 | secondExp = 0.0000 ; firstPlusLast= 0.0000 ; thirdExp= 0.0000; evaluated= 0.0000; 152 | debug = false; 153 | System.out.print("Enter f(x) = "); 154 | formule = br.readLine(); 155 | System.out.print("Enter a = "); 156 | a = Float.parseFloat(br.readLine()); // readline() returns String by default 157 | System.out.print("Enter b = "); 158 | b = Float.parseFloat(br.readLine()); 159 | System.out.print("Is the value of n given?(y/n) :- "); 160 | choice = br.readLine(); 161 | if(choice.equals("y") || choice.equals("Y")){ 162 | System.out.print("Enter n = "); 163 | n = Float.parseFloat(br.readLine()); 164 | h = (b-a)/n; 165 | } 166 | else{ 167 | System.out.print("Enter h = "); 168 | h = Float.parseFloat(br.readLine()); 169 | n = (b-a)/h; 170 | } 171 | 172 | 173 | System.out.print("1) I want all steps to be shown in output\n2) I only want final integral value\nChoice = "); 174 | if(br.readLine().equals("1")){ 175 | debug = true; 176 | } 177 | 178 | valueOfX = new ArrayList(); 179 | 180 | // add values of x from x0 to xn to a List 181 | for (i=0;i<=(int)(n);i++) { 182 | valueOfX.add(String.format("%s",a+(i*h))); 183 | } 184 | 185 | // convert list to array of String[] 186 | String[] list = new String[valueOfX.size()]; 187 | valueOfX.toArray(list); 188 | 189 | // store f(x) inital value 190 | eachFOfX = formule; 191 | 192 | if(debug){ 193 | listFOfX = new ArrayList(); 194 | System.out.printf("a : %f\nb : %f\nn : %f\nh : %f\nx : ",a,b,n,h); 195 | } 196 | 197 | i=0; 198 | // iterate through each value of X 199 | for(String eachXValue : valueOfX) { 200 | if(debug) System.out.print(eachXValue+" "); 201 | 202 | // replace exponential e with its value 203 | eachFOfX = eachFOfX.replace("e",String.valueOf("2.71828")); 204 | 205 | eachFOfX = eachFOfX.replace("x",String.valueOf(eachXValue)); 206 | evaluated = (double)RecursiveParser.eval(eachFOfX); 207 | if(debug) listFOfX.add(String.valueOf(evaluated)); 208 | 209 | if( i == 0 || i == (n) ){ 210 | firstPlusLast = firstPlusLast + evaluated; 211 | } 212 | else if( (i) % 2 != 0 ){ 213 | secondExp = secondExp + evaluated; 214 | } 215 | else if( (i) % 2 == 0 ){ 216 | thirdExp = thirdExp + evaluated; 217 | } 218 | ++i; 219 | 220 | // restore value of f(x) to orginal formula after replacing 221 | eachFOfX = formule; 222 | } 223 | if(debug){ 224 | list = new String[listFOfX.size()]; 225 | listFOfX.toArray(list); 226 | System.out.print("\nf(x) : "); 227 | for ( String fx : listFOfX){ 228 | System.out.printf("%s ", fx); 229 | } 230 | System.out.printf("\nh/3 : %f\nf(x0) + f(xn) : %f\nf(x1)+f(x3)+f(x5)+...f(x[n-1] : %f\nf(x2)+f(x4)+f(x6)+...f(x[n-2] : %f\n",(h/3),firstPlusLast,secondExp,thirdExp); 231 | } 232 | double finalSimpsonsIntergralValue = h/3*(firstPlusLast + (4*secondExp) + (2*thirdExp)); 233 | System.out.println("Final answer: "+finalSimpsonsIntergralValue); 234 | } 235 | public static void main(String args[]){} 236 | } 237 | -------------------------------------------------------------------------------- /EasyKtuMath/RecursiveParser.java: -------------------------------------------------------------------------------- 1 | package math.modulesix; 2 | import java.lang.*; 3 | // Format:- 4 | // expression = term | expression `+` term | expression `-` term 5 | // term = factor | term `*` factor | term `/` factor 6 | // factor = `+` factor | `-` factor | `(` expression `)` 7 | // | number | functionName factor | factor `^` factor 8 | public class RecursiveParser { 9 | public static double eval(final String str) { 10 | return new Object() { 11 | int pos = -1, ch; 12 | 13 | void nextChar() { 14 | ch = (++pos < str.length()) ? str.charAt(pos) : -1; 15 | } 16 | 17 | boolean eat(int charToEat) { 18 | while (ch == ' ') nextChar(); 19 | if (ch == charToEat) { 20 | nextChar(); 21 | return true; 22 | } 23 | return false; 24 | } 25 | 26 | double parse() { 27 | nextChar(); 28 | double x = parseExpression(); 29 | if (pos < str.length()) throw new RuntimeException("Unexpected: " + (char)ch); 30 | return x; 31 | } 32 | 33 | double parseExpression() { 34 | double x = parseTerm(); 35 | for (;;) { 36 | if (eat('+')) x += parseTerm(); // addition 37 | else if (eat('-')) x -= parseTerm(); // subtraction 38 | else return x; 39 | } 40 | } 41 | 42 | double parseTerm() { 43 | double x = parseFactor(); 44 | for (;;) { 45 | if (eat('*')) x *= parseFactor(); // multiplication 46 | else if (eat('/')) x /= parseFactor(); // division 47 | else return x; 48 | } 49 | } 50 | 51 | double parseFactor() { 52 | if (eat('+')) return parseFactor(); // unary plus 53 | if (eat('-')) return -parseFactor(); // unary minus 54 | 55 | double x; 56 | int startPos = this.pos; 57 | if (eat('(')) { // parentheses 58 | x = parseExpression(); 59 | eat(')'); 60 | } else if ((ch >= '0' && ch <= '9') || ch == '.') { // numbers 61 | while ((ch >= '0' && ch <= '9') || ch == '.') nextChar(); 62 | x = Double.parseDouble(str.substring(startPos, this.pos)); 63 | } else if (ch >= 'a' && ch <= 'z') { // functions 64 | while (ch >= 'a' && ch <= 'z') nextChar(); 65 | String func = str.substring(startPos, this.pos); 66 | x = parseFactor(); 67 | if (func.equals("sqrt")) x = Math.sqrt(x); 68 | else if (func.equals("sin")) x = Math.sin(Math.toRadians(x)); 69 | else if (func.equals("cos")) x = Math.cos(Math.toRadians(x)); 70 | else if (func.equals("tan")) x = Math.tan(Math.toRadians(x)); 71 | else throw new RuntimeException("Unknown function: " + func); 72 | } else { 73 | throw new RuntimeException("Unexpected: " + (char)ch); 74 | } 75 | 76 | if (eat('^')) x = Math.pow(x, parseFactor()); // exponentiation 77 | 78 | return x; 79 | } 80 | }.parse(); 81 | } 82 | 83 | public static void main(String[] args) { 84 | System.out.println(""); 85 | } 86 | } 87 | 88 | 89 | -------------------------------------------------------------------------------- /EventHandling/LoginGUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @name A Login GUI 3 | * @package GUIProjects 4 | * @file LoginGUI.java 5 | * @author Yedhin Kizhakkethara 6 | * @email yedhin1998@gmail.com 7 | * @link https://github.com/yedhink/KTU-Java 8 | * @copyright Copyright (c) 2018 ikigai, All Rights Reserved. 9 | * @license MIT 10 | * @create 23-04-2018 11 | */ 12 | package guiprojects; 13 | import java.awt.TextField; 14 | import java.awt.*; 15 | import java.awt.Frame; 16 | import java.awt.Panel; 17 | import java.awt.Button; 18 | import java.awt.FlowLayout; 19 | import java.awt.event.ActionEvent; 20 | import java.awt.event.ActionListener; 21 | import javax.swing.JOptionPane; 22 | 23 | class LoginGUI extends Frame { 24 | // declare variables 25 | private Label label1,label2; 26 | private TextField txtF1; 27 | private TextField passF; 28 | private Button buttonExit,buttonLogin; 29 | private Panel panelLogin; 30 | 31 | // Looking for a better way to store this. 32 | private final String uid = "Yedhin"; 33 | private final String pass = "*123#"; 34 | 35 | // Constructor for the class 36 | public LoginGUI(){ 37 | // set title 38 | super("EventHandling basics"); 39 | txtF1 = new TextField(); 40 | passF = new TextField(); 41 | label1 = new Label(); 42 | label2 = new Label(); 43 | panelLogin = new Panel(); 44 | buttonExit = new Button("close"); 45 | buttonLogin = new Button("login"); 46 | 47 | // explictely setting layout. default is Flow itself 48 | setLayout(new FlowLayout()); 49 | 50 | 51 | // create a label for username 52 | label1.setAlignment(Label.CENTER); 53 | label1.setText("Username"); 54 | add(label1); // add the label to the Frame 55 | 56 | // set initial width of the the TextFields 57 | txtF1.setColumns(20); 58 | passF.setColumns(20); 59 | 60 | // changing echoing of characters typed in password field into * 61 | passF.setEchoChar('*'); 62 | 63 | add(txtF1); 64 | 65 | // create a label for password 66 | label2.setAlignment(Label.CENTER); 67 | label2.setText("Password"); 68 | add(label2); 69 | 70 | add(passF); 71 | 72 | // create an exit button 73 | add(buttonExit); 74 | 75 | // login button 76 | panelLogin.add(buttonLogin); 77 | add(panelLogin); 78 | 79 | // create an listener object. 80 | theHandler handler = new theHandler(); 81 | 82 | // add action listeners for both the buttons 83 | buttonExit.addActionListener(handler); 84 | buttonLogin.addActionListener(handler); 85 | } 86 | 87 | // EventHandling class 88 | private class theHandler implements ActionListener { 89 | public void actionPerformed(ActionEvent e) { 90 | // Event on close button 91 | if( e.getSource() == buttonExit ) { 92 | dispose(); 93 | System.exit(0); 94 | } 95 | 96 | // Event on login button 97 | if(e.getSource() == buttonLogin){ 98 | if(txtF1.getText().equals(uid) && passF.getText().equals(pass)){ 99 | JOptionPane.showMessageDialog(null,"Successfull Login"); 100 | try{ 101 | Thread.sleep(1000); 102 | } 103 | catch(InterruptedException ex){ 104 | System.out.println("Exception "+ex+" Caught"); 105 | } 106 | dispose(); 107 | System.exit(0); 108 | } 109 | else{ 110 | JOptionPane.showMessageDialog(null,"Invalid Login Credentials"); 111 | } 112 | } 113 | } 114 | } 115 | 116 | // main starts here 117 | public static void main(String[] args) { 118 | LoginGUI frameObj = new LoginGUI(); 119 | frameObj.setSize(600,600); 120 | frameObj.setVisible(true); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /EventHandling/sum_2nos.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WELCOME TO JAVA APPLET 5 | 6 | 7 | 8 |
9 |

WELCOME TO THE APPLET

10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /EventHandling/sum_2nos.java: -------------------------------------------------------------------------------- 1 | package guiprojects; 2 | import java.awt.*; 3 | import java.awt.event.*; 4 | import java.applet.*; 5 | 6 | public class sum_2nos extends Applet implements ActionListener 7 | { 8 | TextField t1 = new TextField(10); 9 | TextField t2 = new TextField(10); 10 | TextField t3 = new TextField(10); 11 | 12 | Label l1 = new Label("First no"); 13 | Label l2 = new Label("Second no"); 14 | Label l3 = new Label("Sum "); 15 | Button b = new Button("ADD "); 16 | 17 | public void init() 18 | { 19 | //t1.setForeground(Color = Red); 20 | add(l1); 21 | add(t1); 22 | add(l2); 23 | add(t2); 24 | add(l3); 25 | add(t3); 26 | add(b); 27 | b.addActionListener(this); 28 | } 29 | 30 | public void actionPerformed(ActionEvent e) 31 | { 32 | if(e.getSource() == b) 33 | { 34 | int n1 = Integer.parseInt(t1.getText()); 35 | int n2 = Integer.parseInt(t2.getText()); 36 | t3.setText(" " + (n1+n2)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /JDBCTemplate/JdbcBeg.java: -------------------------------------------------------------------------------- 1 | 2 | import java.sql.*; 3 | /******************** 4 | Contributed by leo 5 | ->make sure that you have JDBC Driver install. 6 | ->You should have a SQL server Running. 7 | ************************/ 8 | public class JdbcBeg implements Runnable{ 9 | //Threads are just used to make Server timings 10 | public void run() { 11 | System.out.print("Connecting to SQL DB waiting For Connection "); 12 | for (int i = 0; i < 5; i++) { 13 | try { 14 | Thread.sleep(1000); 15 | System.out.print("."); 16 | } catch (InterruptedException e) { 17 | System.out.println("Error while threading ."); 18 | } 19 | } 20 | System.out.println("\nYou are connected to SQL DB"); 21 | 22 | } 23 | public static void main(String[] args) { 24 | Thread thread=new Thread(new JdbcBeg()); 25 | thread.start(); 26 | try{ 27 | Thread.sleep(5000); 28 | thread.join(); 29 | }catch (InterruptedException e){ 30 | System.out.println("Something wrong while threading."); 31 | } 32 | 33 | try { 34 | //Connection is obtained using GET method. Replace the url,username,password with yours. 35 | Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306", "root", "nopass1234"); 36 | Statement statement = connection.createStatement(); 37 | statement.executeUpdate("use employee");//Use your update statements instead of mine. 38 | ResultSet resultSet = statement.executeQuery("select * from livesin");//Use your select queries here 39 | //Result is stored as a ResultSet object 40 | while (resultSet.next()) { 41 | System.out.println(); 42 | System.out.println(resultSet.getString("pname") + " " + resultSet.getString("street") + " " + resultSet.getString("city") + " "); 43 | //Replace the column label to columns used in the table 44 | } 45 | 46 | } catch (SQLException sqlException) { 47 | System.out.println("Error occurred while processing"); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /JDBCTemplate/README.md: -------------------------------------------------------------------------------- 1 | # Requirements 2 | 3 | * Set up MySql 4 | * [in Windows](https://www.roseindia.net/mysql/installing-mysql-on-windows10.shtml) 5 | * [in most common Linux distros](https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html) 6 | 7 | **in Arch Linux setting up both MySql and JDBC can be found [here](https://wiki.archlinux.org/index.php/JDBC_and_MySQL)** 8 | 9 | * Set up JDBC 10 | * [in Windows](https://blogs.msdn.microsoft.com/brian_swan/2011/03/02/getting-started-with-the-sql-server-jdbc-driver/) 11 | * [in Linux](https://stackoverflow.com/questions/5307048/where-do-i-install-a-jdbc-driver-on-ubuntu) 12 | 13 | ## Creating your own Database in MySql (optional) 14 | 15 | After completing the installations , follow this [link](https://www.liquidweb.com/kb/create-a-mysql-database-on-linux-via-command-line/) and create a database of your own. 16 | Do this if you want to learn working with MySql. Else make use of the already created DB in the given example(s). 17 | 18 | ## Usage 19 | 20 | Its important to note that , when , say you're in Arch Linux, then your default vendor is mariadb , thus in the program you would have to replace "mysql" with "mariadb". 21 | Rest of the execution as same as what had been done with other programs , compile and run `JdbcBeg.java` 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 ikigai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Loops/Foreach.java: -------------------------------------------------------------------------------- 1 | package loops; 2 | /* A program to find average of nos 1,4,2,6,7 3 | * Using For Each loops 4 | * */ 5 | 6 | class Foreach 7 | { 8 | public static void main(String args[]){ 9 | int sum=0,av; 10 | int avg [] = {1,4,2,6,7}; 11 | for(int i : avg){ 12 | sum +=i; 13 | 14 | } 15 | av = sum/avg.length; 16 | System.out.println("Average is "+av); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Loops/forloop.java: -------------------------------------------------------------------------------- 1 | /* Multiplication Table Of A Number*/ 2 | 3 | package loops; 4 | import java.util.Scanner; 5 | 6 | public class forloop { 7 | 8 | public static void main(String[] args) { 9 | Scanner in = new Scanner(System.in); 10 | System.out.print("Enter Number Whose Multiplication Table Is To Be Displayed = "); 11 | int N = in.nextInt(); 12 | int i=0; 13 | for(i=1;i<=10;i++){ 14 | System.out.println(N+" x "+ i +" = "+N*i); 15 | } 16 | in.close(); // make this a practice (._.) 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Loops/ifelse.java: -------------------------------------------------------------------------------- 1 | /* Check this problem out : 2 | * https://www.hackerrank.com/challenges/java-if-else/problem 3 | */ 4 | 5 | package loops; 6 | import java.util.Scanner; 7 | 8 | public class ifelse { 9 | 10 | public static void main(String[] args) { 11 | 12 | Scanner sc=new Scanner(System.in); 13 | System.out.print("Enter an integer value, n = "); 14 | int n=sc.nextInt(); 15 | String ans=""; 16 | if(n%2==1){ 17 | ans = "Weird"; 18 | } 19 | else{ 20 | if(n>20){ 21 | ans = "Not Weird"; 22 | } 23 | else if(n>=2&&n<5){ 24 | ans = "Not Weird"; 25 | } 26 | 27 | else if(n>=6&&n<=20){ 28 | ans = "Weird"; 29 | } 30 | else if(n==0){ 31 | ans = "Such Weird. Much Wow"; 32 | } 33 | } 34 | System.out.println(ans); 35 | sc.close(); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Loops/quadraticseries.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.io.*; 3 | 4 | class quadraticseries{ 5 | public static void main(String args[]){ 6 | int sum; 7 | 8 | Scanner in = new Scanner(System.in); 9 | int t = in.nextInt(); 10 | 11 | for(int i=0;i [Install JDK](https://www.codenotfound.com/java-download-install-jdk-8-windows.html) 48 | 1. For coding make use of IDEs like [IntelliJ](https://www.jetbrains.com/idea/download/index.html#section=linux) 49 | or Text Editors like [Sublime Text](https://www.sublimetext.com/3) 50 | or the classic and powerful command line editor [Vim](https://www.vim.org/download.php) which i use. `¯\_(ツ)_/¯` 51 | 52 | # How to use my repositiory? 53 | Assuming that you've already installed the above requirements and it is in a working condition. Then:- 54 | 1. Fork the repository(optional) 55 | 1. Clone/Download the files into your local machine 56 | ###### For Linux Users :- 57 | [Set up git](https://help.github.com/articles/set-up-git/) in your local machine 58 | Then from command line create a clone in your local machine by:- 59 | ```bash 60 | git clone https://github.com/yedhink/KTU-Java.git 61 | ``` 62 | ###### For Other Users :- 63 | Follow this [documentation](https://help.github.com/articles/cloning-a-repository/) 64 | 65 | # Content 66 | In the programs that I've done, I have covered and most importantly used concepts such as: 67 | 68 | 1. [Classes and Objects](https://www.tutorialspoint.com/java/java_object_classes.htm) 69 | 1. [Operators and their Precedence](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html) 70 | 1. [Packages](https://www.tutorialspoint.com/java/java_packages.htm) 71 | 1. [Method Overiding and Overloading](https://www.programcreek.com/2009/02/overriding-and-overloading-in-java-with-examples/) 72 | 1. [Static Instances](https://www.javatpoint.com/static-keyword-in-java) 73 | 1. [Threads](https://www.javaworld.com/article/2077138/java-concurrency/introduction-to-java-threads.html) 74 | 1. [String](https://www.tutorialspoint.com/java/java_strings.htm) 75 | 1. [Streams and IO](https://docs.oracle.com/javase/1.5.0/docs/api/java/io/package-summary.html) 76 | 1. [Exception Handling](https://docs.oracle.com/javase/tutorial/essential/exceptions/) 77 | 1. [AWT](https://www.javatpoint.com/java-awt) 78 | 1. [Applet](https://docs.oracle.com/javase/tutorial/deployment/applet/) 79 | 1. [Swing](http://zetcode.com/tutorials/javaswingtutorial/) 80 | 1. [File Handling](http://www.dailyfreecode.com/code/file-handling-java-3430.aspx) 81 | 1. [Event Handling](https://docs.oracle.com/javase/tutorial/uiswing/events/index.html) 82 | 1. [Data Structures](http://java.wikia.com/wiki/Data_Structures) 83 | 1. [Interfaces](https://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html) 84 | 1. [Arrays](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html) 85 | 1. [JDBC](https://docs.oracle.com/javase/tutorial/jdbc/basics/index.html) 86 | 87 | ## A bit about what each directory in my repo has to offer 88 | 89 | ``` 90 | 1) EastKtuMath 91 | └──── Numerical Integration using Trapezoidal or Simpsons Methods 92 | └──── Get all the math steps as output (optional) 93 | └──── Streams for IO 94 | └──── An exquisite expression parser included within 95 | └──── And yes you guessed it right! I used to do all my math assignements this way. :D 96 | 97 | 2) Threads 98 | └──── By Runnable Interface 99 | └──── By Extending Thread Class 100 | └──── Runnable Interface in Main 101 | └──── Synchronization 102 | └──── Some fine practice problems 103 | 104 | 3) EventHandling 105 | └──── Creates a simple login Graphical User Interface(GUI) 106 | └──── Creates an Applet program to add 2 numbers 107 | └──── Covers basics of java.awt,java.applet and some of Swing 108 | └──── Learn basics of Listeners and Events 109 | └──── Basics from this required in upcoming programs 110 | 111 | 4) Overloading and Overriding 112 | └──── Learn the basics of Overloading,Overriding 113 | └──── Dynamic Method Dispatching 114 | └──── What's super() and what is "this"? You will see 115 | └──── Basics of jump statements 116 | └──── Interfaces and Implementation 117 | └──── Basics of Packages 118 | └──── File Handling basics 119 | 120 | 5) S3CsSgpa 121 | └──── Well? Want to apply what you've learnt? This is your opportunity. 122 | └──── Creates a simple GUI to find your SGPA 123 | └──── Sorting 124 | └──── Data Structures 125 | └──── Provides a great idea on javax.swing(the 'x' matters :p) 126 | └──── Love designing? Play with java.awt.Color 127 | 128 | 6) Data Types And Operators 129 | └──── Must needed basics. Dont miss this one. 130 | └──── Different Data Types 131 | └──── Type Casting 132 | └──── Parsing Data Types 133 | └──── Assignment 134 | └──── Arithmetic 135 | └──── Unary 136 | └──── Relational 137 | └──── TypeComparison 138 | └──── Bitwise 139 | └──── Conditional 140 | 141 | 7) 2darray 142 | └──── Learn inputting into a 2d Array 143 | └──── Addition of Matrices 144 | └──── Multiplication of Matrices 145 | 146 | 8) Loops 147 | └──── The name itself suggests what this offers :p 148 | └──── For loops 149 | └──── if-else-if statements 150 | 151 | 9) Abstract Keyword 152 | └──── What is the "abstract" keyword? 153 | └──── An example to explain in detail. 154 | 155 | 10) JDBCTemplate 156 | └──── Java Database Connectivity 157 | └──── Basics of mysql 158 | └──── Basics of JDBC 159 | └──── Reading and writing from DB 160 | ``` 161 | 162 | # What's next? 163 | Now what you waiting for? Compile all the `*.java` files and run it. 164 | 165 | If you're using an IDE like Intellij then i suggest you follow this [documentation](https://www.jetbrains.com/help/idea/2017.1/creating-running-and-packaging-your-first-java-application.html). 166 | 167 | For all others, the most easiest way would be to fire up your Terminal Emulator or Command Line(cmd) for Windows users and change directory (eg:- cd S3CsSgpa) into the one of the directories in my repo. 168 | 169 | Then compile into the same directory (which the "." represents) by: 170 | 171 | ```bash 172 | javac -d . *.java 173 | ``` 174 | 175 | After creating the compiled .class file, just run it using (avoid the .class extension): 176 | 177 | ```bash 178 | java classWhichConsistsOfMainMethod 179 | ``` 180 | 181 | What if it's part of a Package? No problemo. After compiling, run: 182 | 183 | ```bash 184 | java nameOfPackage.filename 185 | ``` 186 | 187 | # Overviews 188 | ![](https://github.com/yedhink/KTU-Java/blob/master/.gif/EasyKtuMath.gif "Run the Main class only") 189 | 190 | ### Your SGPAs a click away... 191 | ![](https://github.com/yedhink/KTU-Java/blob/master/.gif/S3CsSgpa.gif "CheckSgpa") 192 | 193 | # Contribute 194 | Have you been looking for open source repositories to contribute? Look no further! You have come to the right place. 195 | It's important to stick on to the [Contribution guidelines](https://github.com/yedhink/KTU-Java/blob/master/CONTRIBUTING.md) while contributing. 196 | Try and complete the TODO list. Let's work together :) 197 | 198 | ## TODO list 199 | 200 | - [x] Java Database Connectivity(JDBC) -> Basics and Implementaion 201 | - [ ] Make the Graphical User Interfaces look better 202 | - [x] Applets -> Undone since it's deprecated from JDK 9 203 | - [x] Basics and exmaples of abstract keyword 204 | - [x] 2-D array and examples 205 | - [x] Standalone examples for Operators and their Precedence 206 | 207 | # Contact 208 | Having issues in the program? Open up an issue in the issues counter, so that I could know about it. 209 | 210 | Feel free to contact me via [Linkedin](https://www.linkedin.com/in/yedhin1998/) if you have any questions. 211 | 212 | # Credits 213 | [Oracle Java Documentation](http://www.oracle.com/technetwork/java/javase/overview/index.html), [tutorialspoint](https://www.tutorialspoint.com/index.htm) were great references. 214 | 215 | ## License 216 | This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/yedhink/KTU-Java/blob/master/LICENSE) file for details 217 | 218 | ## Spread the word 219 | Liked the project? Just give it a star :star: and spread the word! 220 | -------------------------------------------------------------------------------- /S3CsSgpa/CheckSgpa.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @name Check Sgpa 3 | * @package GUIProjects 4 | * @file CheckSgpa.java 5 | * @author Yedhin Kizhakkethara 6 | * @email yedhin1998@gmail.com 7 | * @link https://github.com/yedhink/KTU-Java 8 | * @copyright Copyright @ ikigai, All Rights Reserved. 9 | * @license MIT 10 | * @create 23-04-2018 11 | */ 12 | 13 | package guiprojects; 14 | import javax.swing.JOptionPane; 15 | import javax.swing.JLabel; 16 | import javax.swing.JComboBox; 17 | import javax.swing.JButton; 18 | import javax.swing.UIManager; 19 | import javax.swing.plaf.ColorUIResource; 20 | import java.awt.Color; 21 | import java.awt.FlowLayout; 22 | import java.awt.Frame; 23 | import java.awt.event.*; 24 | import java.awt.event.ActionEvent; 25 | import java.awt.event.ActionListener; 26 | import java.io.*; 27 | import java.util.Collections; 28 | import java.util.Comparator; 29 | import java.util.HashMap; 30 | import java.util.LinkedHashMap; 31 | import java.util.LinkedList; 32 | import java.util.List; 33 | import java.util.Map; 34 | import java.util.Map.Entry; 35 | 36 | class gui extends Frame { 37 | private static JComboBox jcb = new JComboBox<>(); 38 | private static JButton buttonFind , buttonTopTen; 39 | private static String pathReg = "./reg.txt" , pathSgpa = "./sgpa.txt"; 40 | private static String key,value; 41 | private static HashMap map = new HashMap<>(); 42 | public static synchronized void populate() throws FileNotFoundException, IOException { 43 | FileInputStream fReg = new FileInputStream(pathReg); 44 | FileInputStream fSgpa = new FileInputStream(pathSgpa); 45 | BufferedReader fileR = new BufferedReader(new InputStreamReader(fReg)); 46 | BufferedReader fileS = new BufferedReader(new InputStreamReader(fSgpa)); 47 | while ( ( ( key = fileR.readLine() ) != null ) && ( value = fileS.readLine() ) != null ) { 48 | jcb.addItem(key); 49 | map.put(key, value); 50 | } 51 | map = (HashMap)sortByComparator((Map)map,false); 52 | fileR.close(); 53 | fileS.close(); 54 | } 55 | public gui(){ 56 | // explictely setting layout. default is Flow itself 57 | setLayout(new FlowLayout()); 58 | jcb.setEditable(true); 59 | add(jcb); 60 | buttonFind = new JButton("Find Sgpa"); 61 | add(buttonFind); 62 | buttonTopTen = new JButton("Find Top Ten"); 63 | add(buttonTopTen); 64 | theHandler handler = new theHandler(); 65 | buttonFind.addActionListener(handler); 66 | buttonTopTen.addActionListener(handler); 67 | } 68 | 69 | // EventHandling class 70 | private class theHandler implements ActionListener { 71 | public void actionPerformed(ActionEvent event) { 72 | String selectedRegNum = (String) jcb.getSelectedItem(); 73 | if(event.getSource() == buttonFind){ 74 | value = map.get(selectedRegNum); 75 | if (value!=null) { 76 | if(selectedRegNum.equals("FIT16CS086")){ 77 | JOptionPane.showMessageDialog(null,"\tCongrats!You're the topper\nYour sgpa : "+value); 78 | } 79 | else{ 80 | JOptionPane.showMessageDialog(null,"Your sgpa : "+value); 81 | /* Uncomment and try this out if you want to play with colors :D 82 | new UIManager(); 83 | UIManager.put("OptionPane.background", Color.decode("#d3d3d3")); 84 | UIManager.put("Panel.background", Color.decode("#d3d3d3")); 85 | JOptionPane.showMessageDialog(null, "Your sgpa : "+value, "Gray", JOptionPane.INFORMATION_MESSAGE); 86 | */ 87 | } 88 | } 89 | else { 90 | JOptionPane.showMessageDialog(null,"No such register number in S3 CS"); 91 | /* 92 | new UIManager(); 93 | UIManager.put("OptionPane.background", Color.decode("#FF0000")); 94 | UIManager.put("Panel.background", Color.decode("#FF0000")); 95 | JOptionPane.showMessageDialog(null, "No such register number in S3 CS", "Red", JOptionPane.INFORMATION_MESSAGE); 96 | */ 97 | } 98 | } 99 | if(event.getSource() == buttonTopTen){ 100 | int i = 0; 101 | String msg = ""; 102 | for (Map.Entry entry : map.entrySet()) { 103 | if(i>10){ 104 | break; 105 | } 106 | key = entry.getKey(); 107 | value = entry.getValue(); 108 | msg += key+" "+value+"\n"; 109 | ++i; 110 | } 111 | JOptionPane.showMessageDialog(null,msg); 112 | } 113 | } 114 | } 115 | 116 | private static Map sortByComparator(Map unsortMap, final boolean order){ 117 | List> list = new LinkedList>(unsortMap.entrySet()); 118 | // Sorting the list based on values 119 | Collections.sort(list, new Comparator>(){ 120 | public int compare(Entry o1,Entry o2){ 121 | if (order){ 122 | return o1.getValue().compareTo(o2.getValue()); 123 | } 124 | else{ 125 | return o2.getValue().compareTo(o1.getValue()); 126 | } 127 | } 128 | }); 129 | 130 | // Maintaining insertion order with the help of LinkedList 131 | Map sortedMap = new LinkedHashMap(); 132 | for (Entry entry : list){ 133 | sortedMap.put(entry.getKey(), entry.getValue()); 134 | } 135 | return sortedMap; 136 | } 137 | } 138 | public class CheckSgpa { 139 | public static void main(String[] args) throws IOException , InterruptedException, FileNotFoundException { 140 | Thread t = new Thread(new Runnable(){ 141 | public void run(){ 142 | try{ 143 | gui.populate(); 144 | Thread.sleep(100); 145 | } 146 | catch (Exception e){ 147 | System.out.println(e); 148 | } 149 | } 150 | }); 151 | t.start(); 152 | t.join(); 153 | gui frame = new gui(); 154 | frame.setSize(600,600); 155 | // Uncomment to play around with colors 156 | //frame.setBackground(Color.decode("#000")); 157 | frame.setVisible(true); 158 | } 159 | } 160 | 161 | -------------------------------------------------------------------------------- /S3CsSgpa/reg.txt: -------------------------------------------------------------------------------- 1 | FIT15CS007 2 | FIT15CS013 3 | FIT15CS048 4 | FIT16CS001 5 | FIT16CS002 6 | FIT16CS003 7 | FIT16CS004 8 | FIT16CS005 9 | FIT16CS006 10 | FIT16CS007 11 | FIT16CS008 12 | FIT16CS009 13 | FIT16CS010 14 | FIT16CS011 15 | FIT16CS013 16 | FIT16CS014 17 | FIT16CS015 18 | FIT16CS016 19 | FIT16CS017 20 | FIT16CS018 21 | FIT16CS019 22 | FIT16CS020 23 | FIT16CS021 24 | FIT16CS022 25 | FIT16CS023 26 | FIT16CS024 27 | FIT16CS025 28 | FIT16CS026 29 | FIT16CS027 30 | FIT16CS028 31 | FIT16CS029 32 | FIT16CS030 33 | FIT16CS031 34 | FIT16CS032 35 | FIT16CS033 36 | FIT16CS034 37 | FIT16CS035 38 | FIT16CS036 39 | FIT16CS037 40 | FIT16CS038 41 | FIT16CS039 42 | FIT16CS040 43 | FIT16CS041 44 | FIT16CS042 45 | FIT16CS043 46 | FIT16CS044 47 | FIT16CS045 48 | FIT16CS046 49 | FIT16CS047 50 | FIT16CS048 51 | FIT16CS049 52 | FIT16CS050 53 | FIT16CS051 54 | FIT16CS052 55 | FIT16CS053 56 | FIT16CS054 57 | FIT16CS055 58 | FIT16CS057 59 | FIT16CS058 60 | FIT16CS059 61 | FIT16CS060 62 | FIT16CS062 63 | FIT16CS063 64 | FIT16CS064 65 | FIT16CS065 66 | FIT16CS066 67 | FIT16CS067 68 | FIT16CS068 69 | FIT16CS069 70 | FIT16CS070 71 | FIT16CS071 72 | FIT16CS072 73 | FIT16CS073 74 | FIT16CS074 75 | FIT16CS075 76 | FIT16CS076 77 | FIT16CS077 78 | FIT16CS078 79 | FIT16CS079 80 | FIT16CS080 81 | FIT16CS081 82 | FIT16CS082 83 | FIT16CS083 84 | FIT16CS084 85 | FIT16CS085 86 | FIT16CS086 87 | FIT16CS087 88 | FIT16CS088 89 | FIT16CS089 90 | FIT16CS090 91 | FIT16CS091 92 | FIT16CS092 93 | FIT16CS093 94 | FIT16CS094 95 | FIT16CS095 96 | FIT16CS096 97 | FIT16CS097 98 | FIT16CS098 99 | FIT16CS099 100 | FIT16CS100 101 | FIT16CS101 102 | FIT16CS102 103 | FIT16CS103 104 | FIT16CS104 105 | FIT16CS105 106 | FIT16CS106 107 | FIT16CS107 108 | FIT16CS108 109 | FIT16CS109 110 | FIT16CS110 111 | FIT16CS111 112 | FIT16CS112 113 | FIT16CS113 114 | FIT16CS114 115 | FIT16CS115 116 | FIT16CS116 117 | FIT16CS117 118 | FIT16CS118 119 | FIT16CS119 120 | FIT16CS120 121 | FIT16CS121 122 | FIT16CS122 123 | FIT16CS123 124 | FIT16CS124 125 | FIT16CS125 126 | FIT16CS126 127 | FIT16EC053 128 | -------------------------------------------------------------------------------- /S3CsSgpa/sgpa.txt: -------------------------------------------------------------------------------- 1 | 0 2 | .6250 3 | .8750 4 | 8.145 5 | 7.312 6 | 6.333 7 | 5.166 8 | 5.916 9 | 8.541 10 | 7.812 11 | 4.583 12 | .4583 13 | 6.916 14 | 1.416 15 | 6.250 16 | 7.791 17 | .5000 18 | 7.166 19 | 5.833 20 | 6.583 21 | 7.312 22 | 8.125 23 | 8.062 24 | 7.479 25 | 1.250 26 | 5.416 27 | 7.750 28 | 3.166 29 | .9583 30 | .2083 31 | 6.750 32 | 7.833 33 | 8.229 34 | 2.500 35 | 4.166 36 | 6.458 37 | 8.041 38 | 8.270 39 | 7.437 40 | 6.166 41 | 5.625 42 | 4.125 43 | 7.479 44 | 7.812 45 | 6.000 46 | 7.541 47 | 6.875 48 | 6.541 49 | 7.666 50 | 6.937 51 | 6.666 52 | 8.875 53 | 8.375 54 | 6.833 55 | 6.166 56 | 3.416 57 | 2.250 58 | 2.416 59 | 5.666 60 | 7.458 61 | 6.875 62 | 8.083 63 | 4.583 64 | 7.395 65 | 2.333 66 | 7.395 67 | 6.416 68 | 7.729 69 | 3.041 70 | 2.416 71 | 7.875 72 | 6.416 73 | 6.958 74 | 1.458 75 | 6.958 76 | 2.000 77 | 6.791 78 | 3.812 79 | .2083 80 | 8.437 81 | 5.916 82 | 5.958 83 | 6.208 84 | 4.375 85 | 8.583 86 | 9.125 87 | 7.500 88 | 6.958 89 | 7.583 90 | 8.791 91 | 8.291 92 | 6.166 93 | 8.145 94 | 7.729 95 | 8.562 96 | 8.333 97 | 4.250 98 | 7.375 99 | 5.625 100 | 6.750 101 | 6.166 102 | 5.583 103 | 8.229 104 | 8.750 105 | 5.500 106 | 4.000 107 | 7.500 108 | 7.500 109 | 5.645 110 | 3.041 111 | 3.958 112 | 7.937 113 | 4.666 114 | 6.875 115 | 7.833 116 | 7.270 117 | 9.104 118 | 5.333 119 | 5.333 120 | 7.812 121 | 5.250 122 | 6.854 123 | 7.708 124 | 5.625 125 | 8.000 126 | 7.562 127 | 7.166 128 | -------------------------------------------------------------------------------- /Threads/BasicThreadsByExtending.java: -------------------------------------------------------------------------------- 1 | package threads; 2 | class thread extends Thread { 3 | public void run(){ 4 | for (int i = 0; i<10 ; ++i) { 5 | System.out.println(Thread.currentThread().getId() + " shows "+i); 6 | try { 7 | Thread.sleep(100); 8 | } catch(Exception e){ 9 | e.printStackTrace(); 10 | } 11 | } 12 | } 13 | } 14 | 15 | public class BasicThreadsByExtending { 16 | public static void main(String[] args) { 17 | thread obj1 = new thread(); 18 | thread obj2 = new thread(); 19 | thread obj3 = new thread(); 20 | obj1.start(); 21 | obj2.start(); 22 | obj3.start(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Threads/BasicThreadsByMainOnly.java: -------------------------------------------------------------------------------- 1 | package threads; 2 | public class BasicThreadsByMainOnly { 3 | public static void main(String[] args) { 4 | Thread obj1 = new Thread (new Runnable(){ 5 | public void run(){ 6 | for (int i = 0; i<10 ; ++i) { 7 | System.out.println(Thread.currentThread().getId() + " shows "+i); 8 | try { 9 | Thread.sleep(100); 10 | } catch(Exception e){ 11 | e.printStackTrace(); 12 | } 13 | } 14 | } 15 | } 16 | );//runnable method ends here 17 | obj1.start(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Threads/BasicThreadsByRunnable.java: -------------------------------------------------------------------------------- 1 | package threads; 2 | class thread implements Runnable { 3 | public void run(){ 4 | for (int i = 0; i<10 ; ++i) { 5 | System.out.println(Thread.currentThread().getId() + " shows "+i); 6 | try { 7 | Thread.sleep(100); 8 | } catch(Exception e){ 9 | e.printStackTrace(); 10 | } 11 | } 12 | } 13 | } 14 | 15 | public class BasicThreadsByRunnable { 16 | public static void main(String[] args) { 17 | Thread obj1 = new Thread(new thread()); 18 | Thread obj2 = new Thread(new thread()); 19 | Thread obj3 = new Thread(new thread()); 20 | obj1.start(); 21 | obj2.start(); 22 | obj3.start(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Threads/BasicThreadsBySync.java: -------------------------------------------------------------------------------- 1 | package threads; 2 | public class BasicThreadsBySync { 3 | 4 | // Initializing count as zero 5 | public static int count = 0; 6 | 7 | public static synchronized void countMethod() { 8 | ++count; 9 | } 10 | 11 | public static void main(String[] args) { 12 | 13 | // Thread 1 14 | Thread t1 = new Thread ( new Runnable() { 15 | public void run() { 16 | for ( int i=0; i<10000; ++i){ 17 | // Statement to be clarified. 18 | // System.out.println(count++); 19 | // Simply count++ without print statement yields Final count as a random value 20 | // count++; 21 | countMethod(); 22 | } 23 | } 24 | }); 25 | 26 | // Thread 2 27 | Thread t2 = new Thread ( new Runnable() { 28 | public void run() { 29 | for ( int i=0; i<10000; ++i){ 30 | // Statement to be clarified. 31 | // System.out.println(count++); 32 | // Simply count++ without print statement yields Final count as a random value 33 | // count++; 34 | countMethod(); 35 | } 36 | } 37 | }); 38 | 39 | t1.start(); 40 | t2.start(); 41 | 42 | // Wait till completion of both threads 43 | try{ 44 | t1.join(); 45 | t2.join(); 46 | } 47 | catch(Exception e){ 48 | System.out.println(e); 49 | } 50 | 51 | // Final Count 52 | System.out.println("Final count : "+count); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Threads/MaxValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @name Find maximum value in an array of int 3 | * @package multithreadingexamples 4 | * @file MaxValue.java 5 | * @author Yedhin Kizhakkethara 6 | * @email yedhin1998@gmail.com 7 | * @link https://github.com/yedhink/KTU-Java 8 | * @copyright Copyright (c) 2018 ikigai, All Rights Reserved. 9 | * @license MIT 10 | * @create 23-04-2018 11 | */ 12 | // Find the max value in an array of integers using 4 threads 13 | package threads.examples; 14 | import java.util.*; 15 | class Largest extends Thread { 16 | int[] arr; 17 | int lo,hi; 18 | long large; 19 | Largest(int[] arr, int lo, int hi, long large){ 20 | this.arr = arr; 21 | this.lo = lo; 22 | this.hi = hi; 23 | this.large = large; 24 | } 25 | public void run(){ 26 | for (int i=lo; i large) { 28 | large = arr[i]; 29 | } 30 | } 31 | } 32 | public long getLargestInThread(){ 33 | return large; 34 | } 35 | } 36 | 37 | public class MaxValue { 38 | public static void main(String[] args) throws InterruptedException{ 39 | int[] arr = new int[1000*1000]; 40 | long maximum = 0; 41 | Random rnd = new Random(); 42 | for (int i =0; i!", but you should structure your program such that the threads print their greetings in reverse order. 10 | 11 | ## 3) Shared counter(SharedCounter.java) 12 | 13 | Write a program called SharedCounter.java in which 10 threads each increment a shared int counter 10 times. When all the threads have finished, print the final value of the counter. If the initial value is zero, do you always get 100? Arrange for your code to sometimes print the wrong answer. (Hint: try using some well-placed calls to Thread.yield() or Thread.sleep().) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Threads/ReverseHello.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @name Reverse and Print 3 | * @package multithreadingexamples 4 | * @file ReverseHello.java 5 | * @author Yedhin Kizhakkethara 6 | * @email yedhin1998@gmail.com 7 | * @link https://github.com/yedhink/KTU-Java 8 | * @copyright Copyright (c) 2018 ikigai, All Rights Reserved. 9 | * @license MIT 10 | * @create 23-04-2018 11 | */ 12 | package threads.examples; 13 | import java.util.*; 14 | class thread extends Thread { 15 | String hello = ""; 16 | String[] words; 17 | thread(String hello){ 18 | words = hello.split(" "); 19 | for(int i=words.length-1; i>=0; --i){ 20 | this.hello+=words[i]+" "; 21 | } 22 | // do below statement inorder to reverse each word in the sentence 23 | //this.hello = new StringBuffer(hello).reverse().toString(); 24 | } 25 | public void run() { 26 | // inorder to print array of strings 27 | //System.out.println(Arrays.toString(words)); 28 | System.out.println(this.hello); 29 | } 30 | } 31 | public class ReverseHello { 32 | public static void main(String[] args) throws InterruptedException { 33 | thread[] t = new thread[50]; 34 | for (int i=0; i<50; ++i) { 35 | t[i] = new thread("Hello from Thread <"+(i+1)+">!"); 36 | t[i].start(); 37 | t[i].join(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Threads/SharedCounter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @name Synchronization example 3 | * @package multithreadingexamples 4 | * @file SharedCounter.java 5 | * @author Yedhin Kizhakkethara 6 | * @email yedhin1998@gmail.com 7 | * @link https://github.com/yedhink/KTU-Java 8 | * @copyright Copyright (c) 2018 ikigai, All Rights Reserved. 9 | * @license MIT 10 | * @create 23-04-2018 11 | */ 12 | package threads.examples; 13 | public class SharedCounter { 14 | public static int count = 0; 15 | public static synchronized void incrementCount(){ 16 | ++count; 17 | } 18 | public static void main(String[] args) throws Exception{ 19 | for (int i=0; i<10; ++i) { 20 | Thread t = new Thread( new Runnable() { 21 | public void run(){ 22 | for (int j=0; j<10; ++j) { 23 | incrementCount(); 24 | } 25 | } 26 | }); 27 | t.start(); 28 | t.join(); 29 | } 30 | System.out.println(count); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tags: -------------------------------------------------------------------------------- 1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ 2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ 3 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ 4 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team // 5 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ 6 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/ 7 | !_TAG_PROGRAM_VERSION 0.0.0 /6aa62c97/ 8 | 1) Max value(MaxValue.java) Threads/README.md /^## 1) Max value(MaxValue.java)$/;" s 9 | 2) Reverse hello(ReverseHello.java) Threads/README.md /^## 2) Reverse hello(ReverseHello.java)$/;" s 10 | 3) Shared counter(SharedCounter.java) Threads/README.md /^## 3) Shared counter(SharedCounter.java)$/;" s 11 | A Overloading and Overriding/overriding.java /^class A{$/;" c 12 | A bit about what each directory in my repo has to offer README.md /^## A bit about what each directory in my repo has to offer$/;" s 13 | AbsractAreas Abstract Keyword/AbstractAreas.java /^class AbsractAreas {$/;" c 14 | AbstractExample Abstract Keyword/AbstractExample.java /^public class AbstractExample {$/;" c 15 | Acknowledgement README.md /^# Acknowledgement$/;" c 16 | ArithmeticOperators Data Types And Operators/ArithmeticOperators.java /^public class ArithmeticOperators {$/;" c 17 | AssignmentOperators Data Types And Operators/AssignmentOperators.java /^public class AssignmentOperators {$/;" c 18 | Attribution CODE_OF_CONDUCT.md /^## Attribution$/;" s 19 | B Overloading and Overriding/overriding.java /^class B extends A{$/;" c 20 | BasicThreadsByExtending Threads/BasicThreadsByExtending.java /^public class BasicThreadsByExtending {$/;" c 21 | BasicThreadsByMainOnly Threads/BasicThreadsByMainOnly.java /^public class BasicThreadsByMainOnly {$/;" c 22 | BasicThreadsByRunnable Threads/BasicThreadsByRunnable.java /^public class BasicThreadsByRunnable {$/;" c 23 | BasicThreadsBySync Threads/BasicThreadsBySync.java /^public class BasicThreadsBySync {$/;" c 24 | BitwiseOperators Data Types And Operators/BitwiseOperators.java /^public class BitwiseOperators {$/;" c 25 | Bug reports CONTRIBUTING.md /^## Bug reports$/;" s 26 | C Overloading and Overriding/overriding.java /^class C extends B{$/;" c 27 | CheckSgpa S3CsSgpa/CheckSgpa.java /^public class CheckSgpa {$/;" c 28 | Code Style CONTRIBUTING.md /^## Code Style$/;" s 29 | CommonDataTypes Data Types And Operators/CommonDataTypes.java /^public class CommonDataTypes {$/;" c 30 | ConditionalOperators Data Types And Operators/ConditionalOperators.java /^public class ConditionalOperators {$/;" c 31 | Contact README.md /^# Contact$/;" c 32 | Content README.md /^# Content$/;" c 33 | Contribute README.md /^# Contribute$/;" c 34 | Creating your own Database in MySql (optional) JDBCTemplate/README.md /^## Creating your own Database in MySql (optional)$/;" s 35 | Credits README.md /^# Credits$/;" c 36 | Documentation CONTRIBUTING.md /^## Documentation$/;" s 37 | Enforcement CODE_OF_CONDUCT.md /^## Enforcement$/;" s 38 | Figure Abstract Keyword/AbstractAreas.java /^ Figure(double a, double b) {$/;" m class:Figure 39 | Figure Abstract Keyword/AbstractAreas.java /^abstract class Figure {$/;" c 40 | Foreach Loops/Foreach.java /^class Foreach $/;" c 41 | H Abstract Keyword/AbstractExample.java /^ \/* abstract *\/ H () {x=1;} \/\/ constructor cannot be abstract$/;" m class:H 42 | H Abstract Keyword/AbstractExample.java /^abstract class H {$/;" c 43 | H1 Abstract Keyword/AbstractExample.java /^class H1 extends H {$/;" c 44 | How to contribute to KTU-Java CONTRIBUTING.md /^# How to contribute to KTU-Java$/;" c 45 | How to use my repositiory? README.md /^# How to use my repositiory? $/;" c 46 | Introduction README.md /^# Introduction$/;" c 47 | JdbcBeg JDBCTemplate/JdbcBeg.java /^public class JdbcBeg implements Runnable{$/;" c 48 | KTU-Java Code of Conduct CODE_OF_CONDUCT.md /^# KTU-Java Code of Conduct$/;" c 49 | Largest Threads/MaxValue.java /^ Largest(int[] arr, int lo, int hi, long large){$/;" m class:Largest 50 | Largest Threads/MaxValue.java /^class Largest extends Thread {$/;" c 51 | License README.md /^## License $/;" s 52 | LoginGUI EventHandling/LoginGUI.java /^ public LoginGUI(){$/;" m class:LoginGUI 53 | LoginGUI EventHandling/LoginGUI.java /^class LoginGUI extends Frame {$/;" c 54 | Made with ❤ by yours truly README.md /^# Made with ❤ by yours truly $/;" c 55 | Main EasyKtuMath/Main.java /^public class Main {$/;" c 56 | MatrixAddUI 2darray/MatrixAddUI.java /^class MatrixAddUI{$/;" c 57 | MatrixMult 2darray/MatrixMult.java /^class MatrixMult{$/;" c 58 | MaxValue Threads/MaxValue.java /^public class MaxValue {$/;" c 59 | NumericIntegration EasyKtuMath/NumericIntegration.java /^public class NumericIntegration {$/;" c 60 | OnePlusTwoEqualsTwelve Data Types And Operators/OnePlusTwoEqualsTwelve.java /^public class OnePlusTwoEqualsTwelve {$/;" c 61 | Our Standards CODE_OF_CONDUCT.md /^## Our Standards$/;" s 62 | Overviews README.md /^# Overviews$/;" c 63 | Practice Questions Threads/README.md /^# Practice Questions$/;" c 64 | Primitive Data Types Data Types And Operators/README.md /^## Primitive Data Types$/;" s 65 | Pull requests CONTRIBUTING.md /^## Pull requests$/;" s 66 | Purpose of Abstract Classes Abstract Keyword/README.md /^## Purpose of Abstract Classes$/;" s 67 | Questions CONTRIBUTING.md /^## Questions$/;" s 68 | Rectangle Abstract Keyword/AbstractAreas.java /^ Rectangle(double a,double b) {$/;" m class:Rectangle 69 | Rectangle Abstract Keyword/AbstractAreas.java /^class Rectangle extends Figure {$/;" c 70 | RecursiveParser EasyKtuMath/RecursiveParser.java /^public class RecursiveParser {$/;" c 71 | RelationalOperators Data Types And Operators/RelationalOperators.java /^public class RelationalOperators {$/;" c 72 | Requirements JDBCTemplate/README.md /^# Requirements$/;" c 73 | Requirements README.md /^# Requirements$/;" c 74 | ReverseHello Threads/ReverseHello.java /^public class ReverseHello {$/;" c 75 | SharedCounter Threads/SharedCounter.java /^public class SharedCounter {$/;" c 76 | Simple assignment Data Types And Operators/README.md /^Simple assignment$/;" c 77 | Spread the word README.md /^## Spread the word$/;" s 78 | TODO list README.md /^## TODO list$/;" s 79 | The Java programming language has around 30 operators as summarized below: Data Types And Operators/README.md /^## The Java programming language has around 30 operators as summarized below:$/;" s 80 | The “abstract” Keyword Abstract Keyword/README.md /^## The “abstract” Keyword$/;" s 81 | Triangle Abstract Keyword/AbstractAreas.java /^ Triangle(double a, double b) {$/;" m class:Triangle 82 | Triangle Abstract Keyword/AbstractAreas.java /^class Triangle extends Figure {$/;" c 83 | TypeComparisonOperators Data Types And Operators/TypeComparisonOperators.java /^public class TypeComparisonOperators {$/;" c 84 | UnaryOperators Data Types And Operators/UnaryOperators.java /^public class UnaryOperators {$/;" c 85 | UnderstandingTypeCasting Data Types And Operators/UnderstandingTypeCasting.java /^public class UnderstandingTypeCasting {$/;" c 86 | Usage JDBCTemplate/README.md /^## Usage$/;" s 87 | WELCOME TO THE APPLET EventHandling/sum_2nos.html /^

WELCOME TO THE APPLET<\/H1> <\/CENTER> $/;" h 88 | What's next? README.md /^# What's next?$/;" c 89 | Your SGPAs a click away... README.md /^### Your SGPAs a click away...$/;" S 90 | a EasyKtuMath/NumericIntegration.java /^ private static float a,b,n;$/;" f class:NumericIntegration file: 91 | actionPerformed EventHandling/LoginGUI.java /^ public void actionPerformed(ActionEvent e) {$/;" m class:LoginGUI.theHandler 92 | actionPerformed EventHandling/sum_2nos.java /^ public void actionPerformed(ActionEvent e)$/;" m class:sum_2nos 93 | actionPerformed S3CsSgpa/CheckSgpa.java /^ public void actionPerformed(ActionEvent event) { $/;" m class:gui.theHandler 94 | area Abstract Keyword/AbstractAreas.java /^ abstract double area();$/;" m class:Figure 95 | area Abstract Keyword/AbstractAreas.java /^ double area() {$/;" m class:Rectangle 96 | area Abstract Keyword/AbstractAreas.java /^ double area() {$/;" m class:Triangle 97 | arr Threads/MaxValue.java /^ int[] arr;$/;" f class:Largest 98 | b EasyKtuMath/NumericIntegration.java /^ private static float a,b,n;$/;" f class:NumericIntegration file: 99 | b EventHandling/sum_2nos.java /^ Button b = new Button("ADD ");$/;" f class:sum_2nos 100 | box Overloading and Overriding/reference.java /^ box(double w,double h,double d){$/;" m class:box 101 | box Overloading and Overriding/reference.java /^class box{$/;" c 102 | boxweight Overloading and Overriding/reference.java /^ boxweight(double w,double h,double d,double m){$/;" m class:boxweight 103 | boxweight Overloading and Overriding/reference.java /^class boxweight extends box{$/;" c 104 | br EasyKtuMath/NumericIntegration.java /^ private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));$/;" f class:NumericIntegration file: 105 | buttonExit EventHandling/LoginGUI.java /^ private Button buttonExit,buttonLogin;$/;" f class:LoginGUI file: 106 | buttonFind S3CsSgpa/CheckSgpa.java /^ private static JButton buttonFind , buttonTopTen;$/;" f class:gui file: 107 | buttonLogin EventHandling/LoginGUI.java /^ private Button buttonExit,buttonLogin;$/;" f class:LoginGUI file: 108 | buttonTopTen S3CsSgpa/CheckSgpa.java /^ private static JButton buttonFind , buttonTopTen;$/;" f class:gui file: 109 | charset Overloading and Overriding/csb.java /^class charset implements classHour{$/;" c 110 | choice EasyKtuMath/NumericIntegration.java /^ private static String formule , eachFOfX, choice;$/;" f class:NumericIntegration file: 111 | classHour Overloading and Overriding/csb.java /^interface classHour{$/;" i 112 | classexamples Overloading and Overriding/csb.java /^package classexamples;$/;" p 113 | classexamples Overloading and Overriding/overriding.java /^package classexamples;$/;" p 114 | count Threads/BasicThreadsBySync.java /^ public static int count = 0;$/;" f class:BasicThreadsBySync 115 | count Threads/SharedCounter.java /^ public static int count = 0;$/;" f class:SharedCounter 116 | countMethod Threads/BasicThreadsBySync.java /^ public static synchronized void countMethod() {$/;" m class:BasicThreadsBySync 117 | csb Overloading and Overriding/csb.java /^public class csb{$/;" c 118 | d Overloading and Overriding/reference.java /^ double w,h,d;$/;" f class:box 119 | debug EasyKtuMath/NumericIntegration.java /^ private static boolean debug;$/;" f class:NumericIntegration file: 120 | dim1 Abstract Keyword/AbstractAreas.java /^ double dim1;$/;" f class:Figure 121 | dim2 Abstract Keyword/AbstractAreas.java /^ double dim2;$/;" f class:Figure 122 | eachFOfX EasyKtuMath/NumericIntegration.java /^ private static String formule , eachFOfX, choice;$/;" f class:NumericIntegration file: 123 | eval EasyKtuMath/RecursiveParser.java /^ public static double eval(final String str) {$/;" m class:RecursiveParser 124 | evaluated EasyKtuMath/NumericIntegration.java /^ private static double secondExp , firstPlusLast , thirdExp , evaluated;$/;" f class:NumericIntegration file: 125 | firstPlusLast EasyKtuMath/NumericIntegration.java /^ private static double secondExp , firstPlusLast , thirdExp , evaluated;$/;" f class:NumericIntegration file: 126 | forloop Loops/forloop.java /^public class forloop {$/;" c 127 | formule EasyKtuMath/NumericIntegration.java /^ private static String formule , eachFOfX, choice;$/;" f class:NumericIntegration file: 128 | getLargestInThread Threads/MaxValue.java /^ public long getLargestInThread(){$/;" m class:Largest 129 | getReversed Overloading and Overriding/csb.java /^ public static String getReversed(String value){$/;" m class:csb 130 | gui S3CsSgpa/CheckSgpa.java /^ public gui(){$/;" m class:gui 131 | gui S3CsSgpa/CheckSgpa.java /^class gui extends Frame {$/;" c 132 | guiprojects EventHandling/LoginGUI.java /^package guiprojects;$/;" p 133 | guiprojects EventHandling/sum_2nos.java /^package guiprojects;$/;" p 134 | guiprojects S3CsSgpa/CheckSgpa.java /^package guiprojects;$/;" p 135 | h EasyKtuMath/NumericIntegration.java /^ private static float h;$/;" f class:NumericIntegration file: 136 | h Overloading and Overriding/reference.java /^ double w,h,d;$/;" f class:box 137 | hello Threads/ReverseHello.java /^ String hello = "";$/;" f class:thread 138 | hi Threads/MaxValue.java /^ int lo,hi;$/;" f class:Largest 139 | i EasyKtuMath/NumericIntegration.java /^ private static int i = 0;$/;" f class:NumericIntegration file: 140 | ifelse Loops/ifelse.java /^public class ifelse {$/;" c 141 | incrementCount Threads/SharedCounter.java /^ public static synchronized void incrementCount(){$/;" m class:SharedCounter 142 | init EventHandling/sum_2nos.java /^ public void init()$/;" m class:sum_2nos 143 | jcb S3CsSgpa/CheckSgpa.java /^ private static JComboBox jcb = new JComboBox<>();$/;" f class:gui file: 144 | jumpstatements Overloading and Overriding/jumpstatements.java /^class jumpstatements{$/;" c 145 | k Overloading and Overriding/jumpstatements.java /^ int k=7;$/;" f class:test 146 | key S3CsSgpa/CheckSgpa.java /^ private static String key,value;$/;" f class:gui file: 147 | l1 EventHandling/sum_2nos.java /^ Label l1 = new Label("First no");$/;" f class:sum_2nos 148 | l2 EventHandling/sum_2nos.java /^ Label l2 = new Label("Second no");$/;" f class:sum_2nos 149 | l3 EventHandling/sum_2nos.java /^ Label l3 = new Label("Sum ");$/;" f class:sum_2nos 150 | label1 EventHandling/LoginGUI.java /^ private Label label1,label2;$/;" f class:LoginGUI file: 151 | label2 EventHandling/LoginGUI.java /^ private Label label1,label2;$/;" f class:LoginGUI file: 152 | large Threads/MaxValue.java /^ long large;$/;" f class:Largest 153 | listFOfX EasyKtuMath/NumericIntegration.java /^ private static List listFOfX; $/;" f class:NumericIntegration file: 154 | lo Threads/MaxValue.java /^ int lo,hi;$/;" f class:Largest 155 | loops Loops/Foreach.java /^package loops;$/;" p 156 | loops Loops/forloop.java /^package loops;$/;" p 157 | loops Loops/ifelse.java /^package loops;$/;" p 158 | main 2darray/MatrixAddUI.java /^ public static void main(String args[]){$/;" m class:MatrixAddUI 159 | main 2darray/MatrixMult.java /^ public static void main(String args[]){$/;" m class:MatrixMult 160 | main Abstract Keyword/AbstractAreas.java /^ public static void main(String args[]) {$/;" m class:AbsractAreas 161 | main Abstract Keyword/AbstractExample.java /^ public static void main(String[] args) {$/;" m class:AbstractExample 162 | main Data Types And Operators/ArithmeticOperators.java /^ public static void main(String[] args) {$/;" m class:ArithmeticOperators 163 | main Data Types And Operators/AssignmentOperators.java /^ public static void main(String[] args) {$/;" m class:AssignmentOperators 164 | main Data Types And Operators/BitwiseOperators.java /^ public static void main(String args[]) {$/;" m class:BitwiseOperators 165 | main Data Types And Operators/CommonDataTypes.java /^ public static void main(String[] args) {$/;" m class:CommonDataTypes 166 | main Data Types And Operators/ConditionalOperators.java /^ public static void main(String[] args) {$/;" m class:ConditionalOperators 167 | main Data Types And Operators/OnePlusTwoEqualsTwelve.java /^ public static void main(String[] args) {$/;" m class:OnePlusTwoEqualsTwelve 168 | main Data Types And Operators/RelationalOperators.java /^ public static void main(String[] args) {$/;" m class:RelationalOperators 169 | main Data Types And Operators/TypeComparisonOperators.java /^ public static void main(String[] args) {$/;" m class:TypeComparisonOperators 170 | main Data Types And Operators/UnaryOperators.java /^ public static void main(String[] args) {$/;" m class:UnaryOperators 171 | main Data Types And Operators/UnderstandingTypeCasting.java /^ public static void main(String[] args) {$/;" m class:UnderstandingTypeCasting 172 | main EasyKtuMath/Main.java /^ public static void main(String[] args) throws IOException{$/;" m class:Main 173 | main EasyKtuMath/NumericIntegration.java /^ public static void main(String args[]){}$/;" m class:NumericIntegration 174 | main EasyKtuMath/RecursiveParser.java /^ public static void main(String[] args) {$/;" m class:RecursiveParser 175 | main EventHandling/LoginGUI.java /^ public static void main(String[] args) {$/;" m class:LoginGUI 176 | main JDBCTemplate/JdbcBeg.java /^ public static void main(String[] args) {$/;" m class:JdbcBeg 177 | main Loops/Foreach.java /^ public static void main(String args[]){$/;" m class:Foreach 178 | main Loops/forloop.java /^ public static void main(String[] args) {$/;" m class:forloop 179 | main Loops/ifelse.java /^ public static void main(String[] args) {$/;" m class:ifelse 180 | main Loops/quadraticseries.java /^ public static void main(String args[]){$/;" m class:quadraticseries 181 | main Overloading and Overriding/csb.java /^ public static void main(String args[]){$/;" m class:csb 182 | main Overloading and Overriding/jumpstatements.java /^ public static void main(String args[]) throws FileNotFoundException, InterruptedException, IOEx/;" m class:jumpstatements 183 | main Overloading and Overriding/overriding.java /^ public static void main(String args[]){$/;" m class:overriding 184 | main Overloading and Overriding/reference.java /^ public static void main(String args[]){$/;" m class:reference 185 | main S3CsSgpa/CheckSgpa.java /^ public static void main(String[] args) throws IOException , InterruptedException, FileNotFoundE/;" m class:CheckSgpa 186 | main Threads/BasicThreadsByExtending.java /^ public static void main(String[] args) {$/;" m class:BasicThreadsByExtending 187 | main Threads/BasicThreadsByMainOnly.java /^ public static void main(String[] args) {$/;" m class:BasicThreadsByMainOnly 188 | main Threads/BasicThreadsByRunnable.java /^ public static void main(String[] args) {$/;" m class:BasicThreadsByRunnable 189 | main Threads/BasicThreadsBySync.java /^ public static void main(String[] args) {$/;" m class:BasicThreadsBySync 190 | main Threads/MaxValue.java /^ public static void main(String[] args) throws InterruptedException{$/;" m class:MaxValue 191 | main Threads/ReverseHello.java /^ public static void main(String[] args) throws InterruptedException {$/;" m class:ReverseHello 192 | main Threads/SharedCounter.java /^ public static void main(String[] args) throws Exception{$/;" m class:SharedCounter 193 | map S3CsSgpa/CheckSgpa.java /^ private static HashMap map = new HashMap<>();$/;" f class:gui file: 194 | math.modulesix EasyKtuMath/Main.java /^package math.modulesix;$/;" p 195 | math.modulesix EasyKtuMath/NumericIntegration.java /^package math.modulesix;$/;" p 196 | math.modulesix EasyKtuMath/RecursiveParser.java /^package math.modulesix;$/;" p 197 | n EasyKtuMath/NumericIntegration.java /^ private static float a,b,n;$/;" f class:NumericIntegration file: 198 | operators Data Types And Operators/ArithmeticOperators.java /^package operators;$/;" p 199 | operators Data Types And Operators/AssignmentOperators.java /^package operators;$/;" p 200 | operators Data Types And Operators/BitwiseOperators.java /^package operators;$/;" p 201 | operators Data Types And Operators/CommonDataTypes.java /^package operators;$/;" p 202 | operators Data Types And Operators/ConditionalOperators.java /^package operators;$/;" p 203 | operators Data Types And Operators/OnePlusTwoEqualsTwelve.java /^package operators;$/;" p 204 | operators Data Types And Operators/RelationalOperators.java /^package operators;$/;" p 205 | operators Data Types And Operators/TypeComparisonOperators.java /^package operators;$/;" p 206 | operators Data Types And Operators/UnaryOperators.java /^package operators;$/;" p 207 | operators Data Types And Operators/UnderstandingTypeCasting.java /^package operators;$/;" p 208 | overriding Overloading and Overriding/overriding.java /^class overriding{$/;" c 209 | panelLogin EventHandling/LoginGUI.java /^ private Panel panelLogin;$/;" f class:LoginGUI file: 210 | pass EventHandling/LoginGUI.java /^ private final String pass = "*123#";$/;" f class:LoginGUI file: 211 | passF EventHandling/LoginGUI.java /^ private TextField passF;$/;" f class:LoginGUI file: 212 | pathReg S3CsSgpa/CheckSgpa.java /^ private static String pathReg = ".\/reg.txt" , pathSgpa = ".\/sgpa.txt"; $/;" f class:gui file: 213 | pathSgpa S3CsSgpa/CheckSgpa.java /^ private static String pathReg = ".\/reg.txt" , pathSgpa = ".\/sgpa.txt"; $/;" f class:gui file: 214 | populate S3CsSgpa/CheckSgpa.java /^ public static synchronized void populate() throws FileNotFoundException, IOException {$/;" m class:gui 215 | quadraticseries Loops/quadraticseries.java /^class quadraticseries{$/;" c 216 | reference Overloading and Overriding/reference.java /^class reference{$/;" c 217 | returnMe Abstract Keyword/AbstractExample.java /^ int returnMe () {return x;}$/;" m class:H 218 | revName Overloading and Overriding/csb.java /^ String revName(String value);$/;" m interface:classHour 219 | revName Overloading and Overriding/csb.java /^ public String revName(String value){$/;" m class:charset 220 | run JDBCTemplate/JdbcBeg.java /^ public void run() {$/;" m class:JdbcBeg 221 | run Threads/BasicThreadsByExtending.java /^ public void run(){$/;" m class:thread 222 | run Threads/BasicThreadsByRunnable.java /^ public void run(){$/;" m class:thread 223 | run Threads/MaxValue.java /^ public void run(){$/;" m class:Largest 224 | run Threads/ReverseHello.java /^ public void run() {$/;" m class:thread 225 | secondExp EasyKtuMath/NumericIntegration.java /^ private static double secondExp , firstPlusLast , thirdExp , evaluated;$/;" f class:NumericIntegration file: 226 | show Overloading and Overriding/overriding.java /^ void show(){$/;" m class:A 227 | show Overloading and Overriding/overriding.java /^ void show(){$/;" m class:B 228 | show Overloading and Overriding/overriding.java /^ void show(){$/;" m class:C 229 | simpsonsIntegration EasyKtuMath/NumericIntegration.java /^ public static void simpsonsIntegration() throws IOException {$/;" m class:NumericIntegration 230 | sortByComparator S3CsSgpa/CheckSgpa.java /^ private static Map sortByComparator(Map unsortMap, final boolea/;" m class:gui file: 231 | sum_2nos EventHandling/sum_2nos.java /^public class sum_2nos extends Applet implements ActionListener$/;" c 232 | t1 EventHandling/sum_2nos.java /^ TextField t1 = new TextField(10);$/;" f class:sum_2nos 233 | t2 EventHandling/sum_2nos.java /^ TextField t2 = new TextField(10);$/;" f class:sum_2nos 234 | t3 EventHandling/sum_2nos.java /^ TextField t3 = new TextField(10);$/;" f class:sum_2nos 235 | test Overloading and Overriding/jumpstatements.java /^ test(){$/;" m class:test 236 | test Overloading and Overriding/jumpstatements.java /^ test(String word,int k){$/;" m class:test 237 | test Overloading and Overriding/jumpstatements.java /^class test{$/;" c 238 | theHandler EventHandling/LoginGUI.java /^ private class theHandler implements ActionListener {$/;" c class:LoginGUI 239 | theHandler S3CsSgpa/CheckSgpa.java /^ private class theHandler implements ActionListener {$/;" c class:gui 240 | thirdExp EasyKtuMath/NumericIntegration.java /^ private static double secondExp , firstPlusLast , thirdExp , evaluated;$/;" f class:NumericIntegration file: 241 | thread Threads/BasicThreadsByExtending.java /^class thread extends Thread {$/;" c 242 | thread Threads/BasicThreadsByRunnable.java /^class thread implements Runnable {$/;" c 243 | thread Threads/ReverseHello.java /^ thread(String hello){$/;" m class:thread 244 | thread Threads/ReverseHello.java /^class thread extends Thread {$/;" c 245 | threads Threads/BasicThreadsByExtending.java /^package threads;$/;" p 246 | threads Threads/BasicThreadsByMainOnly.java /^package threads;$/;" p 247 | threads Threads/BasicThreadsByRunnable.java /^package threads;$/;" p 248 | threads Threads/BasicThreadsBySync.java /^package threads;$/;" p 249 | threads.examples Threads/MaxValue.java /^package threads.examples;$/;" p 250 | threads.examples Threads/ReverseHello.java /^package threads.examples;$/;" p 251 | threads.examples Threads/SharedCounter.java /^package threads.examples;$/;" p 252 | trapezoidalIntegration EasyKtuMath/NumericIntegration.java /^ public static void trapezoidalIntegration() throws IOException {$/;" m class:NumericIntegration 253 | triple Abstract Keyword/AbstractExample.java /^ void triple (int n) {x=x*3;}; \/\/ a normal method$/;" m class:H 254 | triple2 Abstract Keyword/AbstractExample.java /^ static int triple2 (int n) {return n*3;}; \/\/ a static method in abstract class is ok.$/;" m class:H 255 | triple3 Abstract Keyword/AbstractExample.java /^ abstract void triple3 (); \/\/ abstract method. Note: no definition.$/;" m class:H 256 | triple3 Abstract Keyword/AbstractExample.java /^ void triple3 () {x=x*3+1;} \/\/ must be defined, else compiler makes a complaint.$/;" m class:H1 257 | twoDArray 2darray/MatrixAddUI.java /^package twoDArray;$/;" p 258 | twoDArray 2darray/MatrixMult.java /^package twoDArray;$/;" p 259 | txtF1 EventHandling/LoginGUI.java /^ private TextField txtF1;$/;" f class:LoginGUI file: 260 | uid EventHandling/LoginGUI.java /^ private final String uid = "Yedhin";$/;" f class:LoginGUI file: 261 | value S3CsSgpa/CheckSgpa.java /^ private static String key,value;$/;" f class:gui file: 262 | valueB Overloading and Overriding/overriding.java /^ int valueB = 5;$/;" f class:B 263 | valueOfX EasyKtuMath/NumericIntegration.java /^ private static List valueOfX;$/;" f class:NumericIntegration file: 264 | volume Overloading and Overriding/reference.java /^ public double volume(){$/;" m class:box 265 | volume Overloading and Overriding/reference.java /^ public double volume(){$/;" m class:boxweight 266 | w Overloading and Overriding/reference.java /^ double w,h,d;$/;" f class:box 267 | weight Overloading and Overriding/reference.java /^ double weight;$/;" f class:boxweight 268 | word Overloading and Overriding/jumpstatements.java /^ String word;$/;" f class:test 269 | words Threads/ReverseHello.java /^ String[] words;$/;" f class:thread 270 | x Abstract Keyword/AbstractExample.java /^ int x;$/;" f class:H 271 | y Abstract Keyword/AbstractExample.java /^ \/* abstract *\/ int y; \/\/ variables cannot be abstract$/;" f class:H 272 | --------------------------------------------------------------------------------