-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay3.java
More file actions
165 lines (132 loc) · 3.26 KB
/
Day3.java
File metadata and controls
165 lines (132 loc) · 3.26 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// public class Day3
// {
// public static void pavan(String name,int... x)
// {
// System.out.println("anjaliiiiiiiiiiiiii");
// }
// public static void sum(int... a)
// {
// System.out.println("var arg");
// }
// public static void sum(int x,int y)
// {
// System.out.println("normal method pavan");
// }
// public static void main(String[] args)
// {
// // sum(2,5);
// // sum(2);
// // sum(1,1,1,2,2,3,4,5,6,7,8,9);
// // pavan("anjali",1,2,3,4,5);
// }
// }
// main method
// public class Day3
// {
// public static void main(String []args)
// {
// System.out.println("anna pavan 12354");
// main(new int[]{1,2,3});
// }
// // public static void main(int []a)
// // {
// // System.out.println("anjali 1265488974");
// // }
// }
// public class Day3
// {
// // longest main method in java
// public static final synchronized void main(String []args)
// {
// System.out.println("anna pavan 100");
// }
// }
// public class Day3
// {
// public static void main(String[] anj)
// {
// int s=0;
// for(int i=0;i<anj.length;i++)
// {
// // System.out.println(anj[i]);
// s=s+Integer.parseInt(anj[i]); //string to int type
// }
// System.out.println("sum:"+s);
// }
// }
// Explain System.out.println()
// public class Day3
// {
// static String name="anjali";
// public static void main(String[] anj)
// {
// System.out.println(Day3.name.length());
// }
// }
// // Day3 = class name
// // name = static variable of type String present in Day3 class
// // length() = method present in String class
// class PrintStream
// {
// println();
// }
// class System
// {
// static PrintStream out ;
// }
// System = classname present in java.lang
// out = static variable present in System class
// println() = the method present in PrintStream class
// the difference b/w b++ b=b+1
// class Day3
// {
// public static void main(String[] args)
// {
// byte b=1;
// // b++;
// b=(byte)(b+1);
// // b=b+1;
// System.out.println(b);
// }
// }
// diff bw == and .equals()
// class Day3
// {
// public static void main(String[] args)
// {
// // int x=10;
// // int y=10;
// // String x = "anjali";
// // String y = "anjali";
// // System.out.print("output:::::");
// // System.out.println(x==y);
// String x = new String("anjali");
// String y = new String("anjali");
// // System.out.println(x==y);
// System.out.println(x.equals(y));
// }
// }
// instanceof
// class Test
// {
// }
// class Day3
// {
// public static void main(String[] args)
// {
// Day3 d1 = new Day3();
// Test t=new Test();
// // System.out.println(d1 instanceof Day3);
// System.out.println(t instanceof Test);
// }
// }
class Day3
{
public static void main(String[] args)
{
// System.out.println(4&5);
// System.out.println(4|5);
System.out.println(4^5);
}
}
// know the diff bw && and & , || and |