-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode 35.txt
69 lines (33 loc) · 1.21 KB
/
code 35.txt
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
/*
* Program: Using Classes
* Date: 5/4/2019
* Programmer: J.Sookha
* Description: using classes - BUT - the wrong way - instead of creating private "fields"
* we created public "fields" (variables) / and in the other class at the bottom
* we creates static variables - note the use of the variables in main method/program
*/
package usingclasses56;
public class usingclasses56{
public static void main(String[] args){
clsComputer c1 = new clsComputer();
//clsComputer.strProcessorChip = "i7";
c1.strProcessorChip = "i7";
System.out.println(c1.strProcessorChip);
//c1.setProcessorChip("i7");
//c1.getProcessorChip();
clsSomething56.intNumber = 56;
clsSomething56.intNumber2 = 57;
}
}
=========================================================================================
package usingclasses56;
public class clsComputer{
//private String strProcessorChip;
public String strProcessorChip;
}
=========================================================================================
package usingclasses56;
public class clsSomething56{
public static int intNumber;
static int intNumber2;
}