Search Header Logo

Test SDIAZ - GrupoE

Authored by Ottho Fon

Computers

University

Used 1+ times

Test SDIAZ - GrupoE
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Seleccione el estilo de comentario correcto que se utiliza para trabajar con Javadoc.

 /* @author Robert */

// @author Robert

/** @author Robert */

/** @author Robert ;

// @author Robert */

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Cual es output del siguiente snippet de codigo?

int y = 5;

int x = (y > 4) ? (4.1 y) : (3 y);

System.out.println(x);

20

15

30

20.5

ninguna

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

¿Cuál de las siguientes opciones es un identificador válido en Java según las reglas de nomenclatura?

my-variable

123identifier

_myIdentifier

break

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

¿Que imprimirá en el siguiente código?

public static void main(String[] laB) {

    double b,c;

double a= ((a=2.0)+(a++))+((b=10.0)/(c=3.0));

System.out.print(a);

}

5

7.0

7.33333

8.33333

No compila

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

 ¿Cuál es el resultado de la siguiente expresión? public class EjemploDePregunta { 

public static void main(String[] args) { 

int a = 5; 

int b = 7; 

boolean result = (++b < 10) || (a > 3); 

System.out.println(result); 

verdadero

falso

La expresión genera un error de

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Que imprime el programa?:

1:public class Exercise{

2: private int x;

3: private boolean y;

4: private String z;

5: public Exercise() {

6: x = 5;

7: y = x > 10;

8: z = y ? "Hello" : "World";

9: }

10: public static void main(String[] args) {

11: Exercise ae = new Exercise();

12: System.out.println("x = " + ae.x);

13: System.out.println("y = " + ae.y);

14: System.out.println("z = " + ae.z);

15: System.out.println("Result = " + (ae.x * ae.z.length() / (ae.y ? ae.x : ae.z.length())));

16: }

17: }

x = 5, y = true, z = "Hello", Result = 2

x = 5, y = true, z = "Hello", Result = 10

x = 5, y = false, z = "World", Result = 1

x = 5, y = false, z = "World", Result = 5

Compilación fallida debido a error en la línea 8

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Supongamos que tenemos una clase llamada "Person" con los atributos "name" y "age". ¿Cuál es la forma correcta de declarar e inicializar un objeto de la clase "Person" llamado "person1" con el nombre "John" y la edad 25?

Person person1 = new Person(); 

person1.name = "John";

person1.age = 25;

Person person1 = Person("John", 25);

Person person1 = new Person("John", 25);

Person person1;

person1.name = "John";

person1.age = 25;

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?