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é imprime este código?

class Empleado {

double salario = 1000;

 

double calcularSalario() {

return salario;

}

}

 

class Gerente extends Empleado {

double calcularSalario() {

return salario + 500;

}

}

 

public class Test {

public static void main(String[] args) {

Empleado e = new Gerente();

System.out.println(e.calcularSalario());

}

}

View this question

¿Qué salida se genera el siguiente código?

class Coche {

String marca = "Toyota";

 

void imprime() {

System.out.println("Marca: " + marca);

}

}

 

public class Test {

public static void main(String[] args) {

Coche c = null;

c.imprime();

}

}

View this question

¿Qué imprime?

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));

}

}

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);

}

}

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

 

class Producto {

double precio = 20.0;

}

 

public class Test {

public static void main(String[] args) {

Producto p1 = new Producto();

Producto p2 = new Producto();

p1.precio = 15.0;

System.out.println(p2.precio);

}

}

 

View this question

¿Qué imprime?

 

class A {

int x = 5;

void mostrar() {

int x = 10;

System.out.println(x);

}

}

public class Test {

public static void main(String[] args) {

A a = new A();

a.mostrar();

}

}

View this question

¿Qué representa this en una clase?

0%
0%
0%
0%
View this question

¿Qué representa this en una clase?

 

View this question

¿Qué imprime?

 

class A {

int valor = 5;

void cambiar(A otro) {

otro.valor = 10;

}

}

public class Test {

public static void main(String[] args) {

A obj = new A();

obj.cambiar(obj);

System.out.println(obj.valor);

}

}

0%
0%
0%
0%
View this question

¿Qué significa que un atributo o un método tengan el nivel de acceso protegido (protected)?

 

0%
0%
0%
0%
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