Aug 06, 2012 · Okay, so now for those who want to go the extra mile, I challenge you to put together a Java program that will allow you to use an abstract Vehicle class and properly output the following console lines: My Car has 2 seats. My Car has 4 wheels. My Bus has 20 seats. My Bus has 6 wheels. Using this Java main class: In PHP, We have a function max() by using this function we can easily get the largest number. But I will first go for PHP code to find the largest of 3 numbers. By this, we can get the logic first. Thereafter, We gonna learn the easiest way to find out the largest number among some given numbers. The employees array above is an array of objects with properties of different data types, from string, numeric, to a date string. The sort() method can be used to sort the array based on the values of one of these properties, such as sorting the array by name, age, or even when they retire. The basic idea is to modify the compare function so it ... Average of all elements in array: 3: Find minimum number in array: 4: Find maximum number in array: 5: Find product of all elements in an array: 6: Copy odd numbers into another array: 7: Print the elements in an array: 8: Sum of 3 consecutive numbers in the input array: 9: Find Modulus Of Every Array Element : 10: Find if an array is a palindrome: 11: Multiplication Tables Array: 12 Nov 13, 2020 · The first demonstration is sorting of number array in ascending order using sort methods. As already mentioned, by default the sort method sorts the array in ascending order. Thus, to sort a numeric array in ascending order, you just have to call the method on the array in question. Given below is an example to show this.