// If your values are stored in an array...
Arrays.sort(valuesArray);
// If they're stored in a List...
Collections.sort(valuesList);
Make use of Java's robust library: // filled with various ints int[] a; // temporary variable for swapping values int temp; // sort with fast, built-in algorithm java.util.Arrays.sort(a); // reverse the array for( int i = 0; i < a.length/2; ++i ) { temp = a[i]; a[i] = a[a.length - i - 1]; a[a.length - i - 1] = temp; } Obviously, if you're concerned with execution speed you could write your own sort method which would sort into descending order instead of ascending order (perhaps by modifying Java's sort algorithm).
You can also use the Collections.sort() method to sort values in an array list. You can also use the Comparable Interface or Comparators for providing custom implementations of sorting algorithms for values inside an ArrayList.
The simplest would be to put the numbers into an int[] (integer array) and pass that to java.util.Arrays.sort(int[]) (a static method), which will sort the array in ascending numerical order. Use a float[] or double[] if you need to sort non-whole numbers. You can also use the Collections.sort(List) method to sort the List directly. Or the Collections.sort(List, Comparator) if you wish to specify your own sorting criteria.
16 bits. Java char values (and Java String values) use Unicode.
Do you mean how do you write a Java program to print out those numbers in ascending order? Because you have specified thosenumbers, I can only assume that the following will suffice:-public int main( String[] args ){System.out.println( "0.235 4.62 7.25 7.89 23.5" );}If you want to know how to sort a general array into ascending order, try Google for sorting algorithms, such as "bubble sort", "insertion sort", "heap sort", "quick sort" etc.
public class BubbleSortAscendingOrderDemo { public static void main(String a[]) { //Numbers which need to be sorted int numbers[] = {23,5,23,1,7,12,3,34,0}; //Displaying the numbers before sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i < numbers.length; i++) { System.out.print(numbers[i]+" "); } System.out.println(); //Sorting in ascending order using bubble sort bubbleSortInAscendingOrder(numbers); //Displaying the numbers after sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i < numbers.length; i++) { System.out.print(numbers[i]+" "); } }
public class CreateDatabase{ public static void main(){ int a=10; int b=20; int result =a+b; System.out.println(result); } }
Snuff films are quite popular in Java and Bali
:-P
Java is not a completely object oriented language, because not all values in Java are Objects. For example, the basic numeric types such as int, long, double, etc., are not objects and need to be "boxed" into objects in order to pass them as Object parameters or call methods on them.
look at the print
There are a a few different websites that offer lessons on Boolean values in Java. The most reliable website is called HomeAndLearn because of its many different lessons.