-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainer.java
More file actions
66 lines (57 loc) · 1.51 KB
/
Copy pathContainer.java
File metadata and controls
66 lines (57 loc) · 1.51 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
public class Container {
public static void main(String[] args){
byte x=24;
int y=x;
System.out.println(y);
// Literal Values:-
int size=32;
char initial='j';
double d=456.709;
boolean isLearning;
isLearning=true;
int z=x+456;
// Sharpen your Pencil:-
float x1=34.5f;
boolean boo=isLearning;
int g=17;
int y1=g;
y1=y1+10;
short s;
System.out.println(y1);
byte b=3;
byte v=b;
short n=12;
n=v;
byte k=127;
}
}
// // Answer 1:-
// // Valid or invalid in java:-
// // int 2cool = 5; Invalid because it is starting with a number
// // double _price = 99.99; Valid because it is starting with an underscore
// // boolean public = true; Invalid because public is a reserved keyword
// // String $name = "Alice"; Valid
// // char firstLetter = 'A'; Valid
// // Answer 2:-
// boolean ho=true;
// char letter='C';
// byte number=127;
// short number00=32000;
// int _number=2100000000;
// long $number=1000000000L;
// float _number$=5.25f;
// double $number_=25.555;
// // Answer 3:-
// String _hello="Hello i'am a programmer";
// char $hi='H';
// int digit001=123123;
// float numbaa90=90.80f;
// double digit=1000.899893;
// // Answer 4:-
// // int class=6767; Compiletime error
// // Answer 5:-
// int flight_number=18727;
// String Airline_name="Air India";
// short Passenger_Capacity=400;
// double Ticket_Price=39009;
// boolean isFlightActive=true;