Ok so i made a game in which a random no. is generated and user have to guess it. The game givesclues like Higher or Lower to user. When a guessed no is found a new jframe opens in a new class gui.class. Now i want to pass the argumets random no and user chances ie counter to gui.class. So how can i pass arguments randomNo and counter from main class ie game.class to gui.class

how can i pass arguments

Are you passing the args to a class's constructor or to a method in the class?
It is coded the same way:
new ClassName(<the args here>);
aRefToTheClass.aMethodInClass(<the args here>);

See the tutorial: http://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html

commented: nice artice... +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.