How to instantiate a class in a Java .class using Visual Studio Code?

  • Thread starter Thread starter AT-Intrinix
  • Start date Start date
A

AT-Intrinix

Guest
I am using Visual Studio Code (version 1.32.3) with Java. I have a .class file called 'RandomGenerator.class' which I want to instantiate from the main. The main.java and RandomGenerator.class are in the same directory.

My statement:

RandomGenerator rdgen = new RandomGenerator(1,1,1,1);

will have an error :RandomGenerator could not be resolved to a type java(16777218)

I tried to include import RandomGenerator; (I don't need but try to see if it is required) - I get an error "RandomGenerator cannot be resolved java(268435846)" at the import statement.

The specification of the constructor given is RandomGenerator(int seed, double lambda, double mu, double rho)

Appreciate help to make it work in Visual Studio Code. Thanks.




AT-Intrinix

Continue reading...
 
Back
Top