lundi 30 octobre 2017

Is there a way to assign a String object as a custom class instance?

Tried to extend from String class but it is final, hence looking for a way so that I can assign a String object as my custom class instance?

Example:

public class MyClass {
    public CustomString cString;
}

MyClass myClass = new MyClass();
Field field = myClass.getField("cString");
field.set(myClass, "TestValue");





Aucun commentaire:

Enregistrer un commentaire