forked from vladutbutnaru/enered-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
57 lines (55 loc) · 1.23 KB
/
Copy pathMain.java
File metadata and controls
57 lines (55 loc) · 1.23 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
package ro.enered.exemple;
public class Main {
public static void main (String[]args){
//PENTRU AFISARE PE ECRAN
System.out.println("CEVA");
//DEFINIREA VARIABILELOR
int a = 4;
int b = 3;
int c;
c = adunare(a,b);
//afisare c
System.out.println(c);
c = scadere(a,b);
//afisare c
System.out.println(c);
InitializareStudent();
initializareStoc();
}
private static int adunare(int a1, int b1){
return a1+b1;
}
private static int scadere(int a1, int b1){
return a1-b1;
}
private static void InitializareStudent(){
/*Student nou
* un nume
* sa invete un nou curs pt un nr de ore
*
*/
//instantiere
Student s = new Student();
//atribuim un nume studentului
s.nume = "Vlad";
//atribuim o clasa studentului
s.grup = 4;
//apelam metoda invata
System.out.println(s.invata("JAVA",5));
}
public static void initializareNota(){
/*atribuim studentului cu numele Ion din grupa 2 nota 8
*
*/
Student s = new Student();
s.nume="Ion";
s.grup = 2;
nota n = new nota();
n.atribuie(s, 8);
System.out.println(n.atribuie(s, 8));
}
public static void initializareStoc(){
Stoc s = new Stoc();
System.out.println(s.calcNr());
}
}