Repository navigation
Expand file tree
/
Copy pathDay6.java
More file actions
75 lines (65 loc) · 1.44 KB
/
Copy pathDay6.java
File metadata and controls
75 lines (65 loc) · 1.44 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
67
68
69
70
71
72
73
package JHomeworks;
public class Day6 {
public static void main(String[] args) {
//1. What is the range of short data type in Java?
// a) -128 to 127
// b) -32768 to 32767 // Answer is B
// c) -2147483648 to 2147483647
// d) None of the mentioned
//
//
//
// 2. What is the range of byte data type in Java?
// a) -128 to 127 //Answer is A
// b) -32768 to 32767
// c) -2147483648 to 2147483647
// d) None of the mentioned
// View Answer
//
//
//
// 3. Which of the following are legal lines of Java code?
// 1. int w = (int)888.8;
// 2. byte x = (byte)100L;
// 3. long y = (byte)100;
// 4. byte z = (byte)100L;
// a) 1 and 2
// b) 2 and 3
// c) 3 and 4
// d) All statements are correct. //answer is D
//
//
//
// What is the output of this program?
//
// class increment {
// public static void main(String args[])
// {
// int g = 3;
// System.out.print(++g * 8);
// }
// }
// a) 25
// b) 24
// c) 32 answer is C
// d) 33
//
//
// What is the output of this program?
//
// class area {
// public static void main(String args[])
// {
// double r, pi, a;
// r = 9.8;
// pi = 3.14;
// a = pi * r * r;
// System.out.println(a);
// }
// }
// a) 301.5656 answer is A
// b) 301
// c) 301.56
// d) 301.56560000
}
}