class Module9Test {
private int x;
Module9Test(){
System.out.println("Entro 1");
}
Module9Test(int x1){
System.out.println("Entro 2");
}
public static void main(String[] args) {
Module9Test m = new Module9Test();
m.x = 100;
}
}
1
class Module9Test {
private int x;
private Module9Test(int x2){
System.out.println("Entro 1");
}
void Module9Test(int x1){
System.out.println("Entro 2");
}
public static void main(String[] args) {
Module9Test m = new Module9Test(9);
m.Module9Test(8);
}
}
2
class Module9Test {
private int x;
private Module9Test(int x2){
System.out.println("Entro 1");
}
public Module9Test(int x1, int x2){
System.out.println("Entro 2");
}
public void doIt(){
System.out.println("Entro do it");
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test(9);
m.doIt();
m = new Module9Test(100,20);
m.doIt();
}
}
3
class Module9Test {
public static int x;
public Module9Test(int x2){
x = x2;
System.out.println(x2);
}
public Module9Test(){
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test(10);
m.x = 10;
m = new Module9Test();
System.out.println(m.x);
}
}
4
class Module9Test {
private int x;
private Module9Test(int x2){
x = x2;
System.out.println(x2);
}
public Module9Test(int x1, int x2){
System.out.println(x2);
new Module9Test(x1);
}
public void doIt(){
System.out.println(x);
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test(5,10);
m.doIt();
}
}
5
class Module9Test {
public int x;
public Module9Test(int x2){
x = x2;
System.out.println(x2);
}
public void setX(int x1){
x = x1;
}
public int getX(){
return x;
}
}
class WhatHappens {
Module9Test m;
public static void main(String[] args) {
m = new Module9Test(10);
m.x = 10;
m.setX(100);
System.out.println(m.getX());
}
}
6
class Module9Test {
public int x;
public Module9Test(){
}
public void setX(int x1){
x = x1;
}
public int getX(){
return x;
System.out.println(x);
}
}
class WhatHappens {
private static Module9Test m;
public static void main(String[] args) {
m = new Module9Test();
m.x = 10;
m.setX(100);
int num = m.getX() + 5;
System.out.println(num);
}
}
7
class Module9Test {
private int x;
public Module9Test(){
setX(5);
}
public void setX(int x1){
x += x1;
}
public int getX(){
return x+=x;
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test();
m.setX(10);
int num = m.getX() + 5;
System.out.println(num);
}
}
8
class Module9Test {
private int x;
void Module9Test(){
x = 0;
}
public Module9Test(Module9Test mt){
x = mt.getX();
}
public Module9Test(int x1){
x = x1;
}
public void setX(int x1){
x += x1;
}
public int getX(){
return x+=x;
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test();
Module9Test m2 = new Module9Test(m);
System.out.println(m2.getX());
}
}
9
class Module9Test {
private int x;
public Module9Test(){
x = 1;
}
public Module9Test(Module9Test mt){
x = mt.getX();
}
public void setX(int x1){
x += x1;
}
public int getX(){
return x+=x;
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test(new Module9Test());
System.out.println(m.getX());
}
}
10
class Module9Test {
public Module9Test(int a, int b, int c){
System.out.println("Entro a");
}
public Module9Test(short a, double b, int c){
System.out.println("Entro b");
}
public Module9Test(byte a, int b, short c){
System.out.println("Entro c");
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test((byte)200,200d,(short)200);
}
}
11
class Module9Test {
public Module9Test(int a, int b, int c){
System.out.println("Entro a");
}
private Module9Test(short a, double b, int c){
System.out.println("Entro b");
}
public Module9Test(byte a, int b, short c){
System.out.println("Entro c");
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test((short)200,200,200);
}
}
12
class Module9Test {
public Module9Test(int a, int b, int c){
System.out.println("Entro a");
}
public Module9Test(short a, double b, int c){
System.out.println("Entro b");
}
public Module9Test(double a, short b, int c){
System.out.println("Entro c");
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test((short)200,200,200);
}
}
13
class Module9Test {
public int x;
public Module9Test(){
}
public Module9Test(int x1){
x1 = x;
}
public Module9Test getX() {
return new Module9Test(6);
}
}
class WhatHappens {
public static void main(String[] args) {
Module9Test m = new Module9Test((short)200);
System.out.println(m.getX().x);
}
}
14
Descargar

QEncapsConstructors