-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.java
More file actions
51 lines (46 loc) · 1.24 KB
/
HelloWorld.java
File metadata and controls
51 lines (46 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*public class HelloWorld{
public static void main(String args[]){ */
//This program will print hello world
/*chuchu
chuchu*/
/* System.out.println(1+1);
System.out.println("Hello World!");
*/
/*
final int age = 20;
age = 21;
System.out.println(age);
*/
/*
int a,b,c;
a=b=c=10;
System.out.println(a+b+c);*/
import java.util.*;
public class HelloWorld
{
public static void main(String[] args)
{
/*System.out.println("How old are you?");
Scanner input = new Scanner(System.in);
int age = input.nextInt();
System.out.println("I am "+age+" years old!");*/
/* int myAge = 20; //Widening Casting
double myOld = myAge;
double myMoney = 120.50d; //Narrowing Casting
int myCash = (int) myMoney;
System.out.println(myAge);
System.out.println(myOld);
System.out.println(myMoney);
System.out.println(myCash);*/
double myInt = Math.ceil(13.5);
int myNumber = Math.abs(-1);
int myMax = Math.max(12,3);
int myMin = Math.min(13,24);
double myRound = Math.round(13.5);
System.out.println(myInt);
System.out.println(myNumber);
System.out.println(myMax);
System.out.println(myMin);
System.out.println(myRound);
}
}