HOW TO CODE JAVA???????????
int[] marks = {50, 55, 60, 70, 80}; System.out.println(marks[0]);// Output: 50 System.out.println(marks[4]);// Output: 80
HOW TO CODE JAVA???????????
int[] marks = {50, 55, 60, 70, 80}; System.out.println(marks[0]);// Output: 50 System.out.println(marks[4]);// Output: 80
Java Code (.java)
public class NewYear{
//using main function
static void main(String... newyearargs){ // defining main() method here
System.out.println("Happy New Year");
}
}
Java Code (.java)
public class MathExample {
//java.lang.Math.round() method example with float and double arguments
public static void main(String[] args) {
double e = 2.71828;
float pi = 3.1415f;
//Math.round() method: float turns to int
int intOfPi = Math.round(pi);
//Math.round() method: double turns to long
long intOfE = Math.round(e);
System.out.println("integer part of pi = " + intOfPi);
System.out.println("integer part of e = " + intOfE);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us