JAVA_CODINGS Telegram 64
44. Array operations.

class ArrayOperations
{
public static void main(String[] args)
{
double[] myList = {1.9, 2.9, 3.4, 3.5};

// Print all the array elements
for (int i = 0; i < myList.length; i++)
{
System.out.println(myList[i] + " ");
}
// Summing all elements
double total = 0;
for (int i = 0; i < myList.length; i++)
{
total += myList[i];
}

System.out.println("Total is " + total);

// Finding the largest element
double max = myList[0];
for (int i = 1; i < myList.length; i++)
{
if (myList[i] > max)
max = myList[i];
}

System.out.println("Max is " + max);
}
}

@java_codings



tgoop.com/java_codings/64
Create:
Last Update:

44. Array operations.

class ArrayOperations
{
public static void main(String[] args)
{
double[] myList = {1.9, 2.9, 3.4, 3.5};

// Print all the array elements
for (int i = 0; i < myList.length; i++)
{
System.out.println(myList[i] + " ");
}
// Summing all elements
double total = 0;
for (int i = 0; i < myList.length; i++)
{
total += myList[i];
}

System.out.println("Total is " + total);

// Finding the largest element
double max = myList[0];
for (int i = 1; i < myList.length; i++)
{
if (myList[i] > max)
max = myList[i];
}

System.out.println("Max is " + max);
}
}

@java_codings

BY Advance Java 👨‍💻


Share with your friend now:
tgoop.com/java_codings/64

View MORE
Open in Telegram


Telegram News

Date: |

Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. How to create a business channel on Telegram? (Tutorial) Hui said the messages, which included urging the disruption of airport operations, were attempts to incite followers to make use of poisonous, corrosive or flammable substances to vandalize police vehicles, and also called on others to make weapons to harm police. Content is editable within two days of publishing How to Create a Private or Public Channel on Telegram?
from us


Telegram Advance Java 👨‍💻
FROM American