Home Tutorialhelp Comment A Better way:

 
 

Comment

Swayam Narain
A Better way:,
December 1, 2008 at 2:13 AM

[b]I've got an alternative and better way to do the same program:
/*Random Number generatior. Program made by - Swayam Narain
* This handy programs generates random numbers and prints them.
* Copyright
*/
public class random
{ public static void main() {
double k=0; int res=0;
for(int i=1;i<=15;i++)//15 random numbers
{
k=Math.random();
res=(int)((k*6)+1);//upto 6

System.out.println(i+": "+res);// prints the Random numbers.
}
}
}

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
General

Randomizer
Randomizer      ... we create an object of the of the Randomizer class and print the values...;upto 500");   Randomizer random = new Randomizer 

Java Beginners

A better Java JSON library?
A better Java JSON library?   A better Java JSON library 

PHP Questions

php or java which is better
php or java which is better  Confused which is best 

Flex Questions

which one is better, Flex or Java?
which one is better, Flex or Java?  Does flex has a scope to survive in IT? Which one of these two, Flex and Java, has a better scope of survival 

Java Interview Questions

which is better server for java applications? apache or jboss?
which is better server for java applications? apache or jboss?  which is better server? apache or jboss 

Java-Tutorials

Which is better .Net or Java?
When a developer needs to choose between Java or .NET to develop a new..., it can also be used on other operating system. Java on the other hand is a programming language that uses Java APIs and Java class libraries to develop 

Spring Framework Questions

what is diffrence between the spring and ejb which is better for small application - Spring
what is diffrence between the spring and ejb which is better for small application  what is diffrence between the spring and ejb which is better... is an open source application for the Java platform whereas EJB is a server-side 

Java-Tutorials

Learning Java Programming for Beginners
of them is online Java training. Learning Java programming for beginners... are uploaded on a daily basis by our Java experts to help beginners in Java... World Java Program Java Beginners tutorial Home page 

Java-Tutorials

Step by Step Java tutorials for beginners
the language better. It is important to understand what is Java and how it is different... the language: Java Tutorial #6- Classes and Objects Java Tutorial for beginners... Tutorial for Beginners - Compiling and Running Java Program from Command Prompt 

Java Beginners

Which one is better for creating a GUI using swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components
Which one is better for creating a GUI using swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components  I am beginner in java application developing.... Which one is better for creating a GUI using 

Subversion Questions

which is better - Subversion
which is better  Dear sir, Could u pls tell which version control is better among the following four. Subversion, git, bazaar, Mercurial 

Java Beginners

java - Java Beginners
)Higher cohesion is better whereas lower coupling is better. Thanks 

Java Tips and Examples

Beginners Java Tutorial
Beginners Java Tutorial     ... with the Java Programming language. This tutorial is for beginners, who wants to learn Java from scratch. In this beginners Java Tutorial you will learn how 

Java Beginners

Java Project - Java Beginners
Java Project  Hey, thanks for everything your doing to make us better. Am trying to work on a project in java am in my first year doing software Engineering and the project is m end of year project. Am really believing 

Design concepts & design patterns Questions

which one is better Struts2 or JSF
which one is better Struts2 or JSF  Which framework is better for the development of core banking solution for the presentation layer Struts2 or JSF2.Request you to explain with the valide reason. Thanks in Advance 

Java Beginners

java - Java Beginners
java  E:\sushant\Core Java\threading>javac -Xlint...; This warning comes when methods of old Java Versions are invoked. Just...   Better will be dont use stop() and if you want to use this tell 

Java Beginners

java beginners - Java Beginners
the following links: http://www.roseindia.net/java/beginners/StringTokenizing.shtml http://www.roseindia.net/java/beginners/tokenizingjavasourcecode.shtml...java beginners  what is StringTokenizer? what is the funciton 

Java Beginners

java - Java Beginners
, Valarmathi  Hi i could better reply, if u explain in brief.. r 

Java Beginners

OOP - Java Beginners
OOP  Which one is better to learn object oriented progamming java or c++? thaks, Bet.  Hello, As of my concern both have different scope and use, you can not merge these. As i java person so i will show you java 

Java Beginners

java - Java Beginners
" please do the favour. Regards, Valarmathi Answers Hi i could better 

Java Beginners

java - Java Beginners
.. and the program you had sent me does not do that.. I would appreciate from a better programmer 

Java Beginners

java porgram - Java Beginners
understand java and its structure that enables to develop a better code. There are many IDEs in use like Eclipse, JDeveloper, JBuilder, NetBeans, Sun Java Studio...java porgram  what is java IDE.  Hi Friend, Integrated 

Java Beginners

Java for beginners
Java for beginners  Java for beginners Which is the best resource... Java video tutorial for beginners. Thanks   Hi, Here are the best resources for Learning Java for beginners: Java Video tutorial Java tutorials 

Java Beginners

Need Help - Java Beginners
Need Help  Hello Sir, Am a beginner of Java. Also i did course... projects in Java as well as J2EE... Can u help me and guide to do a project... better visit following sites for beginers guide http://java.sun.com/javaee 

Java Beginners

interface - Java Beginners
that something in your design are changing frequentlyThe better reference I can 

Java Beginners

Project Concerning - Java Beginners
Project Concerning  Dear Sir, Can you write me URL of any website from where I study the Servlet, JSP project.   Just googled it n im sure u will get many more results. Otherwise, RoseIndia is a better option 

Java-Tutorials

Java guide for beginners
Java guide provided at RoseIndia for beginners is considered best to learn... of Java is better than the classroom training as it is not the teacher who... and understand it completely. Here is more tutorials for Java coding for beginners 

Java Beginners

Java for beginners - Java Beginners
://www.roseindia.net/java/beginners/index.shtml Thanks...Java for beginners  Hi! I would like to ask you the easiest way to understand java as a beginner? Do i need to read books in advance 

Java Beginners

java beginners doubt!
java beginners doubt!  How to write clone()in java strings 

Java Beginners

programming - Java Beginners
programming for java beginners  How to start programming for java beginners 

Java Beginners

Hello - Java Beginners
.. Give me some better idea.   Hi friend, Some points 

Java Beginners

JScrollBar - Java Beginners
has not been changed. It is better to use JScrollPane class to create scroll... to get some examples regarding JScrollPane: http://www.roseindia.net/java/example/java/swing/ChangeScrollBarValue.shtml http://www.roseindia.net/java/example 

Java-Tutorials

Java for complete beginners
Java Guide is available at RoseIndia that help beginners to master... their career as Java professionals. These online training are considered better... java experts who are more than willing to help beginners in any queries 

Java Beginners

job portal - Java Beginners
job portal  1)for creating the job portals which is better?(jsp/html). 2)how we done the validations?give me an example.   Hi friend, This is JavaScript validation code. registration form in jsp 

Java Beginners

String.fromCharCode - Java Beginners
be a better way to do this, any clues? Student 070129 Assignment Four 

Java Beginners

array example - Java Beginners
-element array * while this isn't the best practice, there isn't a much better... for a set of items with no fixed size - a collection class would be better 

Java Beginners

arrays - Java Beginners
, there isn't a much better solution, since the fundamental problem... class would be better * it would, however, be an improvement to have 

Java Beginners

Hiiii - Java Beginners
and variable as per specification I gave you. Then you got some better idea if you need 

Java Beginners

String Array - Java Beginners
value is an integer better to multiply present integer by 10 and then add the next 

Java-Tutorials

Java beginners tutorial
The beginners tutorial in Java helps you learn the basic of Java... these complete online class of Java for the beginners. The Java professional... Java Beginners tutorial Home page 

Java Beginners

Java - Java Beginners
Java  how to declare arrays   Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/array.shtml Thanks 

Java Beginners

beginners questions
beginners questions  I need all the possible Java beginners questions to prepare for an Interview 

Java-Tutorials

Java Video Tutorials for beginners
Java Video Tutorials for beginners are being provided at Roseindia online for free. These video tutorials are prepared by some of the best minds of Java... and knowledge of Java and have poured it down for the used of young programmers 

Java Beginners

Which gives better performace Stack vs Arraylist
Which gives better performace Stack vs Arraylist  I want to implemet a generic Stack implementation. I am confused whether to use java.util.Stack class or to simulate ArrayList as Stack? I am very much concerned about performance 

Java Beginners

html+css - Java Beginners
answer for those wanting to move up to a better way of life while 

Java Beginners

basic java - Java Beginners
basic java  oops concept in java ?  Hi Friend, Please visit the following links: http://www.roseindia.net/java/beginners/oop-in-java.shtml http://www.roseindia.net/java/learn-java-in-a-day/oops.shtml Thanks 

Java-Tutorials

Java Training
and is being considered a better way of learning the Java Language. How and why... World Java Program Java Beginners tutorial Home page...Java training is provided online and offline. While the classroom training 

Java-Tutorials

Java programs for beginners
RoseIndia provides a long list of Java programs for beginners that too... the beginners in Java to learn the Java language. This Java course includes... the Java programs provided for beginners, as every latest topic and update 

Web Development

Social Media Marketing for Beginners
Social Media Marketing for Beginners Most of you may be familiar with social.... If you have a unique content it is better. Use you keywords effectively... an impressive start to the beginners. < 

Java Beginners

'String' vs 'StringBuffer' - Java Beginners
a new object is created for each concat operation. So it is better to use 

Java Beginners

java - Java Beginners
java  ...can you give me a sample program of insertion sorting... with a comment,,on what is algorithm..   Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/arrayexamples 

Technology

Strategies for better Fleet Management
Owner and manger of fleet must follow some important strategies for better Fleet Management. Fleet business has seen a sudden rise in the competition... owner it is advised that all the above Strategies for better Fleet Management 

Java Beginners

java - Java Beginners
java  HOW AND WHERE SHOULD I USE A CONSTRUCTOR IN JAVA PROGRAMMING???   Hi Friend, Please visit the following links: http://www.roseindia.net/java/beginners/Construct.shtml http://www.roseindia.net/java/java 

Java Beginners

java - Java Beginners
links: http://www.roseindia.net/java/java-conversion/DecimalToBinary.shtml http://www.roseindia.net/java/beginners/DataConversion.shtml Thanks...java  write a java program that will read a positive integer 

Java Beginners

Create JAR file - Java Beginners
each time in order to run your JAVA program on some other computer, it;s better...; javac *.java 4. Then type the following :- C:\Answers\Examples>jar -cf 

Java Beginners

Tutorial For Java beginners
Tutorial For Java beginners  I am beginners in Java. Is there any good tutorial and example for beginners in Java? I want to learn Java before Jan... of December 2013. Check the Java Beginners Java Tutorial section for tutorials 

Java Beginners

java downloads - Java Beginners
information. http://www.roseindia.net/java/beginners/download_jdk.shtml...java downloads  hi friends, i would like to download java1.5 .so if possible please send the link for java1.5 free download  Hi friend 

Java Beginners

java beginners - Java Beginners
java beginners   pl. give few example program of signed and unsigned integer bye 

Java Beginners

StringBuilder v/s StringBuffer - Java Beginners
()); } }}------------------------------------read for more information,http://www.roseindia.net/java/beginners... inefficient. StringBuilder (or StringBuffer) are better choices in these cases...() buff.insert(5,"_Java "); //print Hello_Java World 

Java Beginners

java - Java Beginners
java  hi!! i want 2 download jdk latest version so can u pls send me the link..?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/download_jdk.shtml Thanks 

Java Beginners

java beginners - Java Beginners
java beginners   pl. tell me in System.out.print() what is System , what is out , print is method name . is System is a package of class name thanks   Hi Friend, System: It is a standard java class 

Java Beginners

java beginners - Java Beginners
java beginners  pl. let me know the answers of the following questions : 1) A program is unable to create objects of a class declared globally. what could be the problem wtih this construcotr 2) what is the benefit 

Java Beginners

java beginners - Java Beginners
java beginners   pl. let me know how to exterat the decimal numbers from a number i want a java program for it Example if input 12.453 OUTPUT 12 .453 if input 25.7657 OUTPUT 25 

Java Beginners

java beginners - Java Beginners
java beginners  pl. let me know the java program to get the following patteren pl. can i I get it today itself . thank you regargd a a a a a a a a a a a a a and the bewlow 

Java Beginners

java beginners - Java Beginners
java beginners   let me know the java code for the followign patteren *00 **0 *** **0 *0 0 means space whereever the stars are there that is the pattern   class user { public static void main(String 

Java Beginners

java beginners - Java Beginners
java beginners   the patteren u received is not the actual patteren which i need the program i don't know why the patteren does not reach in proper formate to you . it was in upside down triangle form . at the top 

Java Beginners

java beginners - Java Beginners
java beginners   Q. 1 How is class related to data abstraction? Q. 2 what is the relationship between a class and an object? thanks  Hi Friend, 1)Data Abstraction is used to hide certain details that we 

Java Beginners

java beginners - Java Beginners
java beginners   what are real constant? give some example of real constant. which of the following is the valid real constant. 2.0, -16.0, +15/2, 1.9E, 189.E4, 0.67E3.6  Hi Friend, A real constant is a real 

Java Beginners

java beginners - Java Beginners
java beginners  please let me know what is the difference between signed and unsigned integer thanks regards bhavna   Hi Friend, Differences: 1)Signed integer can be a negative number whereas 

Java Beginners

java beginners - Java Beginners
java beginners  the pattern was not in this format * * * * * * * * * * * * * * * * it is like this * * * * * * * * * * * * * * * * thanks   Hi Friend, If you want the following 

Java Beginners

java beginners - Java Beginners
java beginners  thanks for the suggestion so I am sending the patteren in place of dots i want blank space aaaaaaaaaaaaaaaa a............a a........a a.....a a...a a thanks 

Blog

Java Training and Placement
Java Training and Placement How to get better guidance for Java Training and Placement? Java is very hot these days because software industry is looking... developed in Java and open source technologies. So, there is a grate demand of trained 

Java Beginners

Program - Java Beginners
Program Java link list  I need program in Java to copy a file to another file  Hi Friend,For more informationhttp://www.roseindia.net/java/beginners/linked-list-demo.shtml 

Java Beginners

java
, while NetBeans is better for Java EE development...Java Programming tools  what is the differance between eclipes and netbeans ?   Differences: 1)Support for Maven is better in NetBeans 

Java Beginners

java
NetBeans is better for Java EE development...java netbeans  what is the differance between eclipes and netbeans ?   Differences: 1)Support for Maven is better in NetBeans. Because 

Java Beginners

java
, while NetBeans is better for Java EE development...What is Java eclipes  what is the differance between eclipes and netbeans ?   Differences: 1)Support for Maven is better in NetBeans 

Java Beginners

java
is the better option, while NetBeans is better for Java EE development...java eclipes and netbeans tutorial  what is the differance between eclipes and netbeans ?   Differences: 1)Support for Maven is better 

Java Beginners

java
option, while NetBeans is better for Java EE development...java eclipes and net beans  what is the differance between eclipes and netbeans ?   Differences: 1)Support for Maven is better 

Java Beginners

java
is better in NetBeans. Because you can get GlassFish with Java EE package... is the better option, while NetBeans is better for Java EE development...differance between java eclipes and netbeans  what is the differance 

Java Beginners

java beginners - Java Beginners
java beginners  is there any other way to do this ? i want to do by using charAt() function and by decreasing the ascii code by 2 . Write a program to encode a message. The idea is to shift each letter of a alphabet 

Java Beginners

java beginners - Java Beginners
java beginners  pl. let me know the the following 1) difference between parameters and arguments 2) differentiate between recursive funciton and overloaded function thanks   Hi Friend, 1) Parameter 

Java Beginners

Java basics - Java Beginners
://www.roseindia.net/java/beginners/Varconstltr.shtml for more code and examples on Java...literals in java program  Why we use literals in java program?  Hello,A literal is the source code representation of a fixed value 

Java Beginners

java beginners - Java Beginners
java beginners   pl. let me know the program for the following question. A Cyber Café charges for the usage of computer according.../= per minute Write a java program to accept number of hours he worked and print 

Java Beginners

java
, while NetBeans is better for Java EE development... and netbeans ?   Differences: 1)Support for Maven is better in NetBeans. Because you can get GlassFish with Java EE package for NetBeans, it is easier 

Java Beginners

java
option, while NetBeans is better for Java EE development... and netbeans ?   Differences: 1)Support for Maven is better in NetBeans. Because you can get GlassFish with Java EE package for NetBeans 

Java Beginners

java
NetBeans is better for Java EE development... and netbeans ?   Differences: 1)Support for Maven is better in NetBeans. Because you can get GlassFish with Java EE package for NetBeans, it is easier to use 

Java Beginners

java
is better in NetBeans. Because you can get GlassFish with Java EE package for NetBeans... is the better option, while NetBeans is better for Java EE development... are developing MVC based application in Java. Servlet/JSP development is fairly very 

Java Beginners

java beginners - Java Beginners
java beginners   to Write a program to convert entered number into words. Output : You have entered number = 356 The number in words is = three five six. thanks   Hi Friend, Try the following 

Java Beginners

Queue - Java Beginners
Queue  i'm working with queue on java. since im beginners im asking for additional example programs on queue using java to enhance my knowledge. thanks so much for the help! God bless 

Java-Tutorials

Basic Java programming for Beginners
Basic Java programming for Beginners helps them to learn the fundamentals of the language easily and quickly. Java is an Object Oriented Programming language... computer is Java is being used. This opens up a lot of opportunity for young 

Java Beginners

Java - Java Beginners
: http://www.roseindia.net/java/beginners/AddTwoBigNumbers.shtml Thanks...Java  How to add and print two numbers in a java program single...; System.out.prinln(a+b);   Hi friend, Code to add two number in java class 

Java Beginners

Java programming or net beans - Java Beginners
Java programming or net beans  Help with programming in Java? Modify the dog class to include a new instance variable weight (double) and the Cat... better. i am using Netbeans IDE.  Hi Friend, Please clarify 

Java Beginners

Messages Brokers,MQ Series,TIBCO - Java Beginners
Messages Brokers,MQ Series,TIBCO  Any one explain where we use these technologies "Messages Brokers","MQ Series","TIBCO". In the above 3 technologies which one is better for me. i did SCJP1.5 and i am working on Struts 

Java Beginners

Java programming for beginners video tutorials
Java programming for beginners video tutorials  Hi, I am trying to find the Java programming for beginners video tutorials. Let's know the url... for Java beginners. All the tutorials contains free examples. Thanks 

Java Beginners

java compilation error - Java Beginners
java compilation error  Hello madam/sir, i m a beginners in java. My problem is that i want to connect a login form to a frame containing 4 panels. how could i do it?Please help 

Java Beginners

java - Java Beginners
); } } For more information on java visit to : http://www.roseindia.net/java/beginners 

Java Beginners

array - Java Beginners
array  WAP to perform a merge sort operation.  Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/arrayexamples/mergeSort.shtml Hope that it will be helpful for you. Thanks 

Java Beginners

matrices - Java Beginners
matrices  Write a program to add the two matrices  Hi Friend, Please visit the following link: http://www.roseindia.net/java/beginners/MatrixSum.shtml Hope that it will be helpful for you. Thanks 

Java Beginners

java - Java Beginners
: http://www.roseindia.net/java/beginners/Construct.shtml http...java  Java always provides default constructor to ac lass is it true... constructor.If we don't create any constructor for a class java itself creates 

Java Interview Questions

java - Java Interview Questions
and Vector visit to : http://www.roseindia.net/java/beginners/array_list_demo.shtml http://www.roseindia.net/java/beginners/vectordemo.shtml http...java   Difference between Array List and Vector with detailed 

Advertisements Advertisements
 

 

 

DMCA.com