logo

Crowdly

Browser

Add to Chrome

ASIX M03 - Programació bàsica (2024/2025)

Looking for ASIX M03 - Programació bàsica (2024/2025) test answers and solutions? Browse our comprehensive collection of verified answers for ASIX M03 - Programació bàsica (2024/2025) at moodle.elpuig.xeill.net.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

¿Qué tipo de variable se declara dentro de un método?

View this question

¿Cuál es la salida?

 

class Persona {

static int edad = 20;

}

public class Test {

public static void main(String[] args) {

    Persona p1 = new Persona();

    Persona p2 = new Persona();

    p2.edad = 30;

    System.out.println(p1.edad);

}

}

0%
0%
0%
0%
View this question

¿Qué ocurre?

 

class Persona {

private String nombre;

public String getNombre() {

return nombre;

}

public void setNombre(String n) {

nombre = n;

}

}

public class Test {

public static void main(String[] args) {

Persona p = new Persona();

p.nombre = "Juan";

}

}

0%
0%
0%
0%
View this question

¿Qué palabra clave se usa para crear una instancia de una clase en Java?

View this question

¿Qué significa sobrecargar un método?

View this question

¿Qué salida produce este código?

 

class A {

int x = 5;

}

public class Test {

public static void main(String[] args) {

    A a1 = new A();

    A a2 = a1;

    a2.x = 10;

    System.out.println(a1.x);

}

}

View this question

¿Qué imprime?

 

class Figura {

void dibujar() {

System.out.println("Dibujando figura");

}

}

class Circulo extends Figura {

void dibujar() {

System.out.println("Dibujando círculo");

}

}

public class Test {

public static void main(String[] args) {

Figura f = new Circulo();

f.dibujar();

}

}

0%
0%
0%
0%
View this question

¿Qué ocurre con el siguiente código?

class Calculadora {

int sumar(int a, int b) {

return a + b;

}

 

double sumar(double a, double b) {

return a + b;

}

}

 

public class Test {

public static void main(String[] args) {

Calculadora c = new Calculadora();

System.out.println(c.sumar(5, 3.5));

}

}

0%
0%
0%
0%
View this question

¿Qué ocurre si no se define ningún constructor en una clase?

View this question
¿Qué imprime este código?

 

class Padre {

Padre(int x) { System.out.print(x); }

}

class Hijo extends Padre {

Hijo() {

super(5);

System.out.print("B");

}

}

public class Test {

public static void main(String[] args) {

new Hijo();

}

}

View this question

Want instant access to all verified answers on moodle.elpuig.xeill.net?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome