import java.util.Vector; public class Main { public static void main(String[] args) { //Id.jav: the identity-function //applied to an integer System.out.println(new Id().id(1).toString()); //applied to a string System.out.println(new Id().id("hallo").toString()); //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")); System.out.println(new Fac().getFac(6)); System.out.println(new Faculty().m().apply(6)); //Lambda.jav: An lambda expression applied by the method apply System.out.println(new Lambda().m().apply(77)); //applyLambda.jav: A defined lambda expression is applied System.out.println(new applyLambda().m()); Vector> vv = new Vector>(); Vector v1 = new Vector (); v1.addElement(2); v1.addElement(2); Vector v2 = new Vector (); 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> vv1 = new Vector>(); Vector v3 = new Vector (); v3.addElement(2); v3.addElement(2); Vector v4 = new Vector (); 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()); } }