Skip to content

Commit 4ec1522

Browse files
committed
Javascript and Java changes
1 parent ecd4d16 commit 4ec1522

19 files changed

+733
-27
lines changed

.vscode/launch.json

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"type": "java",
9+
"name": "Launch Input",
10+
"request": "launch",
11+
"mainClass": "Input",
12+
"projectName": "PersonalProjects_be73262"
13+
},
714
{
815
"type": "java",
916
"name": "Launch DataStructures",

Java/DataStructuring/DataStructures2.java

+67
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package DataStructuring;
22
import java.util.*;
3+
import java.util.regex.Matcher;
4+
import java.util.regex.Pattern;
35

46
public class DataStructures2 {
57
static void Identity(ArrayList<Object>array){
@@ -34,6 +36,35 @@ public void ObjectFilter(HashMap<Object,Object>Hash){
3436
}
3537
}
3638

39+
interface Thoughts{
40+
Object express(Object inp);
41+
}
42+
43+
interface Expression{
44+
Object express(Object str);
45+
}
46+
47+
interface Digits{
48+
Object count(int inp);
49+
}
50+
51+
public static void WhatFeel(Object num, Expression feel){
52+
Object result = feel.express(num);
53+
System.out.println(result);
54+
}
55+
56+
public static void WhatThink(Object inp, Thoughts idea){
57+
Object result = idea.express(inp);
58+
System.out.println(result);
59+
}
60+
61+
public static void WhatCount(int inp, Digits style){
62+
Object result = style.count(inp);
63+
System.out.println(result);
64+
}
65+
66+
67+
3768
public static void main (String args[]){
3869
ArrayList<Object> Normal = new ArrayList<Object>();
3970
Normal.add(901);
@@ -204,6 +235,42 @@ else if (ft.equals("Fuck")){
204235
System.out.println("It's alright!");
205236
} */
206237

238+
//Patterns
239+
Pattern secretcode = Pattern.compile("Gaelissexy",Pattern.CASE_INSENSITIVE);
240+
Matcher Match = secretcode.matcher("ohhh hahahah gaelis gaelissexy");
241+
boolean thereis = Match.find();
242+
if (thereis){
243+
System.out.println("Oh my god, a stalker to Gael!");
244+
}
245+
else{
246+
System.out.println("What is this? haha");
247+
}
248+
249+
//Java Lambda
250+
Expression happy = (x) -> x + " A sign of happiness!";
251+
Expression sad = (x) -> x + " A sign of sadness huhu.";
252+
WhatFeel(69, sad);
253+
254+
Thoughts Calculating = (x) -> {
255+
if (x.toString().contains("hard")){
256+
x = "This is a sign of effort, commitment, and perseverance!";
257+
}
258+
else if (x.toString().contains("chill")){
259+
x = "This is a sign that you are lacking, uncommitted, and have no direction!";
260+
}
261+
return x;
262+
};
263+
264+
WhatThink("This Programming journey seems both easy AND hard!", Calculating);
265+
266+
267+
268+
Digits CountingOne = (x) -> {
269+
int result = x-1;
270+
return result + " is the distance of your input to 1";
271+
};
207272

273+
WhatCount(1231, CountingOne);
208274
}
275+
209276
}

Java/GaelChild.java

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
public class GaelChild{ //another class that could access GaelClass attributes and methods
2+
private String Secret = "I'm still a virgin!!";
3+
public void OnlyPublic(){
4+
System.out.println("Only public!");
5+
System.out.println("My secret is " + Secret);
6+
}
27

8+
static void CanBeStatic(){
9+
System.out.println("Static is the best!");
10+
}
311

412
public static void main(String[]arg){
513
GaelClass GaelKid1 = new GaelClass("Gael","Ateneo de Manila University","BS MIS, Specialization in Data Science and Analytics","3rd Year",'M',"Single");

Java/GaelSystem.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| GAEL SYSTEM STATS PERFORMANCE |
2+
| NAME | --> Iris
3+
| CURRENT CONDITION | --> Sad
4+
| MONEY | --> 400

Java/Input.java

+20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
import magepack.*;
33
import DataStructuring.*;
4+
import ObjectsSystem.*;
5+
46
import java.util.*;
57
public class Input {
68
public static void main (String args[]){
@@ -44,5 +46,23 @@ public static void main (String args[]){
4446

4547
DataStructures2 Gael = new DataStructures2();
4648
Gael.ObjectFilter(ErrorObject);
49+
50+
System.out.println("\n\n\n");
51+
52+
//PersonObject
53+
54+
/*
55+
Son Haha = new Son();
56+
Haha.Pride(); an example of separate classes in separate files with inheritance
57+
*/
58+
59+
int[]array = {12,312,12,414,1222};
60+
Functions.ArraySum(array);
61+
62+
GaelChild Publicity = new GaelChild();
63+
Publicity.OnlyPublic();
64+
GaelChild.CanBeStatic();
65+
66+
//Gael Iris = new Gael("Iris");
4767
}
4868
}

Java/Mommy.java

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
public class Mommy {
4+
String Attribute = "Strong";
5+
public void Pride(){
6+
System.out.println(String.format("We are %s!",Attribute));
7+
}
8+
}

Java/MultipleClasses.java

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ void Greet(){
5656
System.out.println("Yo!");
5757
}
5858
}
59+
5960

6061

6162
public static void main (String args []){

0 commit comments

Comments
 (0)