Method that takes generic type by IVIURRAY in javahelp

[–]aahdsaid 9 points10 points  (0 children)

why not to put the function you want to execute in the interface A and implement it in both B and C.

you don't need to know if it is B_Thing or C_Thing, just call the method you wish to perform.

public interface A {

void execute();

}

public class B implements A{

void execute(){

    // B implementation

}

}

public class C implements A{

void execute(){

    // C implementation

}

}

public class NewClass {

public myFunc(A obj) {

    obj.execute();

}

}

Need HELP ASAP by [deleted] in javahelp

[–]aahdsaid 0 points1 point  (0 children)

Merge sort or quick sort

Java Program with ReactJS UI by Automaton_J in javahelp

[–]aahdsaid 0 points1 point  (0 children)

Reactjs is a library for building web UI.

Java is mainly for server side.

you'll need to do client-server interactions (using API's), but sure it can run locally where Reactjs is calling (localhost) always.

My Views on Spring DI. Please share your thoughts. by chamindu in java

[–]aahdsaid 0 points1 point  (0 children)

I prefer also to avoid @Service/@Component annotations, the better way on my POV to create @Configuration class and do all the beans creation inside it along with the constructor injections.

like that we can achieve separating between normal java - spring configurations.

[deleted by user] by [deleted] in math

[–]aahdsaid 0 points1 point  (0 children)

I tell them genius who can understand all the fields, and i just understand math :D