-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcode1.java
executable file
·74 lines (44 loc) · 1.2 KB
/
code1.java
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
package newjava;
import java.util.*;
import java.util.regex.*;
public class code1
{
private String firstName;
private String lastName;
private int id;
public code1(String firstName, String lastName, int id) {
this.firstName = firstName;
this.lastName = lastName;
this.id = id;
}
@Override
public String toString() {
return "code1 [firstName=" + firstName + ", lastName=" + lastName + ", id=" + id + "]";
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
int a[]=new int[50];
/*for(int p:a)
{System.out.println(p);
}*/
System.out.println(argu(1,2,3,4,5));
Date d =new Date();
System.out.println(d.getDate());
System.out.println(d.getYear()+1900);
Pattern pat = Pattern.compile("M.");
Matcher mat = pat.matcher("Mustansir");
boolean result=mat.matches();
System.out.println(result);
boolean result1=Pattern.compile("F....n").matcher("Farhan").matches();
System.out.println(result1);
}
public static int argu(int...numba)
{ int rsum=0;
for(int sum:numba)
{
rsum=rsum+sum;
}
return(rsum);
}
}