Files
pl@gohorb.ba-horb.de db040d590e
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 1m37s
modified: Main.jav
modified:   Matrix.jav
	modified:   ../../src/test/java/KPSPresentation.java
2025-09-24 18:35:19 +02:00

106 lines
2.9 KiB
Java

import java.lang.String ;
import java.lang.System;
import java.io.PrintStream;
import java.lang.Character;
import java.lang.Object;
import java.lang.Integer;
import fst;
import Id;
import OLMain;
import Fac;
import Faculty;
import applyLambda;
import java.util.Vector;
import Matrix;
public class Main {
public static main(x) {
/*
new fst().main(5);
System.out.println(new fst().main(5));
//Id.jav: the identity-function
//applied to an integer
System.out.println(new Id().id(1));
//applied to a string
System.out.println(new Id().id("hallo"));
//lamda-Expr
//System.out.println(new Id().id2.apply(1));
//Bug: https://gitea.hb.dhbw-stuttgart.de/JavaTX/JavaCompilerCore/issues/378
//OL.jav: Overloading
OLMain ol = new OLMain();
//the function main is applied to an integer
System.out.println(ol.main(2));
//the main is applied to a double
System.out.println(ol.main(2.0));
System.out.println(ol.main("Hallo"));
//Fac.jav
System.out.println(new Fac().getFac(6));
//Faculty.jav
//System.out.println(new Faculty().fact.apply(6));
//Bug: https://gitea.hb.dhbw-stuttgart.de/JavaTX/JavaCompilerCore/issues/378
System.out.println(new Faculty().getFact(3));
//Lambda.jav: An lambda expression applied by the method apply
//System.out.println(new Lambda().m().apply(77));
//Bug: https://gitea.hb.dhbw-stuttgart.de/JavaTX/JavaCompilerCore/issues/378
//applyLambda.jav: A defined lambda expression is applied
System.out.println(new applyLambda().m());
*/
Vector<Vector<Integer>> vv = new Vector<Vector<Integer>>();
Vector<Integer> v1 = new Vector<Integer> ();
v1.addElement(2);
v1.addElement(2);
Vector<Integer> v2 = new Vector<Integer> ();
v2.addElement(3);
v2.addElement(3);
Matrix m1 = new Matrix();
m1.addElement(v1);
m1.addElement(v2);
//vv.addElement(v1);
//vv.addElement(v2);
//Matrix m1 = new Matrix(vv);
Vector<Vector<Integer>> vv1 = new Vector<Vector<Integer>>();
Vector<Integer> v3 = new Vector<Integer> ();
v3.addElement(2);
v3.addElement(2);
Vector<Integer> v4 = new Vector<Integer> ();
v4.addElement(3);
v4.addElement(3);
Matrix m2 = new Matrix();
m2.addElement(v3);
m2.addElement(v4);
//vv1.addElement(v3);
//vv1.addElement(v4);
//Matrix m2 = new Matrix(vv1);
//Matrix m3 = m1.mul(vv1);
Matrix m3 = m1.mul(m2);
System.out.println(m1.toString() + " * " + m2.toString() + " = " + m3.toString());
/*
//MatrixOP
MatrixOP mOp1 = new MatrixOP();
mOp1.addElement(v1);
mOp1.addElement(v2);
MatrixOP mOp2 = mOp1.mul.apply(mOp1, mOp1);
System.out.println(m1.toString() + " * " + m2.toString() + " = " + mOp2.toString());
}
}
public class MainBug {
public static main(x) {
System.out.println(new fst().main(5));
//System.out.println(new FacultyBug().getFact(3));
}
*/
}
}