-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstruccion_class_java
More file actions
66 lines (60 loc) · 1.62 KB
/
construccion_class_java
File metadata and controls
66 lines (60 loc) · 1.62 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
import java.util.*;
import java.lang.*;
class PrimeraClase{
PrimeraClase(){System.out.println("Primera Clase");}
static PrimeraClase c=new PrimeraClase();
void metodo(int ejecucion){
System.out.println("Metodo1("+ejecucion+")");
}
}
class SegundaClase{
static PrimeraClase primera1=new PrimeraClase();
SegundaClase(){
System.out.println("Segunda Clase");
primera1.metodo(10);
}
void metodo (int ejecucion){
System.out.println("Metodo2("+ejecucion+")");
}
static PrimeraClase primera2=new PrimeraClase();
static SegundaClase segunda1=new SegundaClase();
}
class TerceraClase{
PrimeraClase primera3=new PrimeraClase();
static PrimeraClase primera4=new PrimeraClase();
TerceraClase(){
System.out.println("Tercera Clase");
primera4.metodo(20);
}
void metodo(int ejecucion){
System.out.println("Metodo3("+ejecucion")");
}
static PrimeraClase primera5=new PrimeraClase();
static{
new PrimeraClase();
new SegundaClase();
new TerceraClase();
}
}
public class Ejemplo01{
public static void main(String[]args){
new Ejemplo01();
System.out.println("Programa Principal 1");
new TerceraClase();
SegundaClase.primera2.metodo(30);
System.out.println("Programa Principal");
new TerceraClase();
segunda.metodo(40);
tercera.metodo(50);
}
static SegundaClase segunda=new SegundaClase();
{
System.out.println("Static programa principal 1");
segunda=new SegundaClase();
}
static TerceraClase tercera=new TerceraClase();
{
System.out.println("Static Programa principal 2");
tercera=new TerceraClase();
}
}