Call this method in your main method:
public static double average(int n)
{
double total=0;
double in3=0;
Scanner input= new Scanner(System.in);
int cntr=0;
while(cntr<n)
{
in3=input.nextInt();
total+=in3;
++cntr;
}
return total/n;
Good Luck!
A Program in Java that spawns multiple threads is called a multithreaded program in Java.
Generating random numbers in Java is somewhat of a misnomer because the numbers are actually semi-random.It means to use the program to obtain random integers to use in hypothetical situations such as statistics.
Exactly what do you mean by 'C program in Java'
Many people make Java programs, but if you mean who invented the Java programming language it was James Gosling of Sun Microsystems.
it depends on what you mean... if you want to program it id then suggest you started with a program called robocode it teaches to learn java. other wise if your trying to access a program then do a system search.
It means you have not installed jdk and jre in your machine...
If by system number you mean the version number of the Java language on the client computer, you can useSystem.getProperty("java.version"); .Or, if you want the Java virtual machine version number you can use System.getProperty("java.vm.version"); .Finally, if you want the version number of the operating system, you can use System.getProperty("os.version"); .
A multithreaded program is one that has multiple threads in execution. They may execute parallel to one another or totally without relation to one another. In Java you can create multithreaded programs using Java threads.
// numbers to work with double[] nums = {1, 2, 3, 4.5, 5.5, 6, 7.5, 8, 9, 10}; double sum = 0; // total sum for (int i = 0; i < nums.length; ++i) { sum += nums[i]; } // final average final double mean = (sum / nums.length);
You can write it with Windows NotePad, although using an IDE such as NetBeans or Eclipse is recommended. If you mean you want to learn Java, take a look at the tutorials at the Oracle site.
Java is Robust it mean that java is object oriented programming in which bad program do not crash your computer. it restricts the programmers to correct and remove the errors from the program at the early stage.it is also called Robust because memory management checking is not handled by the programmer there is a mechanism scheduled memory that perform this task. Best Regards Rashid Ali Software Engineer. rashid_se@yahoo.com at facebook
to find the mean of a set of numbers you have to find the total sum of the data divided by the number of addends in the data.