Question
This is using Netbeans. I am trying to run this file to see if I am following the steps correctly but it keeps saying I
This is using Netbeans. I am trying to run this file to see if I am following the steps correctly but it keeps saying I do not have a main method. I've tried doing the "public static void main(String [] args)" code but that just gives an error, and I am pretty certain that we don't need that in this project, due to the fact that we haven't even gone over it in class yet. I have more lines to add to this but I am trying to get a result for num1 before I go on to the rest of the code, which is mostly generating random variables.
I am very new to this so a detailed yet simple explanation would be greatly appreciated!
public class Random { public int main(String[] args) Random rand = new Random(); int num1 = random.nextInt( 20 - 0 + 1 ) + 0; System.out.println(num1); } Information Class "Questions. Question6" does not have a main method. OKStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started