How to dynamically create a class and instantiate it in Java? -


I'm quite new in Java and I'm coming to C ++ from the background. I am working with a class that must be expanded before the protected manufacturer. I need class only in one instance. Is there any way I can dynamically create a class and at the same time can I install?

I have received similar terms, but not marking Mark I have the following code as an example, but of course this syntax is incorrect.

  last ffd.tokens.CountryTokens cToken = new class USA ffd.tokens.CountryTokens {USA (String value) {super (value); }} ("America");    

something like that?

  last ffd token. CountryToken cToken = new ffd.tokens.ountryTokens ("someValue") {// some override};   

Correction:

You can also create a builder in protected ways, which will increase ffd.tokens.CountryTokens (Very strange?) Public abstract class countrybuilder ffd.tokens.CountryTokens {Public Contributor () {super ("useless-data") extends; } Public essence ffd.tokens.CountryTokens creation (string val); }

Use:

  country maker creator = new countrybuilder () {@Override public ffd.tokens.CountryTokens build (string val) {back new FFD. Token Deshtokan (val) {}; }}; Builder.build ("United States"); Builder.build ("Canada");   

I think you get this idea.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -