This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
can anyone tell me how to generate a random number between 1 to 5. I am new tojava programming and i know in c it works like random1=(rand()%5)+1; anbd this gives me a number like 1,2,3,4,5 I need to write a similar Function in JAVA thanks in Advance
Random = new Random(); int number = random.nextInt(5) + 1;
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus