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

  • Question

  • 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


    Wednesday, April 3, 2019 2:46 PM

All replies

  • Hi,

    Welcome to MSDN forum.

    This forum is discussing the installation of visual studio. 

    You could ask questions and search for answers about visual studio code on Stack Overflow and enter issues and feature requests directly in our GitHub repository. Thank you for your understanding!

    Best regards,

    Joyce

     

    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 4, 2019 8:26 AM
  • Sorry for the mistake and inconvenience.  

    AT-Intrinix

    Thursday, April 4, 2019 12:51 PM
  • Hi friend,

    It doesn't matter. If you have problems about visual studio installation, please feel free to let us know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 5, 2019 8:34 AM