-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello.java
More file actions
38 lines (30 loc) · 1.1 KB
/
Hello.java
File metadata and controls
38 lines (30 loc) · 1.1 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
public class Hello {
public static void main (String[] args){
System.out.println("Hello, Dhananjay");
boolean isAlien = false;
if (isAlien==false)
System.out.println("It is not an alien!");
int topScore = 100;
if (topScore<100){
System.out.println("You got the highest score!");
}
int secondTopScore = 60;
if (topScore>secondTopScore && topScore<100){
System.out.println("Greater than second top score and less than 100");
}
int newValue = 50;
if (newValue==50){
System.out.println("This is an error");
}
boolean isCar = false;
if (isCar=true){
System.out.println("This is not supposed to happen");
}
String makeOfCar = "Volkswagen";
boolean isDomestic = makeOfCar == "Volkswagen" ? false:true;
if (isDomestic){
System.out.println("This car is domestic to our country");
}String s = (isDomestic) ? "This car is domestic" : "This car is not domestic";
System.out.println(s);
}
}