Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

CMSC131 EXAM 1 QUESTIONS WITH VERIFIED ANSWERS

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

CMSC131 EXAM 1 QUESTIONS WITH VERIFIED ANSWERS

Vista previa del contenido

CMSC131 EXAM 1 QUESTIONS WITH VERIFIED
ANSWERS


A method that does not access any instance variables should be defined as: - Answers
- Static

When we call a method that has a String parameter, we pass to the method: - Answers
- The address of the String object

Which of the following is an alternative to the equals method to determine whether two
strings are
the same? - Answers - compareTo

Which one of the following correctly describes an immutable object? - Answers - An
object that, once created, cannot have its internal state changed.

What does the new operator return? - Answers - The address in the heap where the
object was created

A constructor method: - Answers - is called after the object has been created

A .class file is the result generated by the: - Answers - Java Compiler

The expression "cat".compareTo("dog") has: - Answers - A negative value.

The class Ceiling provides several methods and one of them can be called as follows:
Ceiling.compute(). What can we
say about the compute() method? - Answers - The compute() method is a static
method.

Which of the following expressions is equivalent to m *= 10 + p; ? - Answers - None of
the above.

When we append a string to another string (e.g., mes += "house"; where mes is a String
variable with the value "my"): - Answers - A new object is created that represents the
concatenation of mes and "house".

The Java compiler generates: - Answers - Bytecode.

How many different combinations of 0's and 1's can be represented with 4 bits? -
Answers - 16

Which of the following are variable names that will compile? - Answers - hot34, _$_145

, The decimal equivalent of the binary number 101 is: - Answers - 5

In the following code fragment, the casting of m to an integer will permanently change
the value of m to:
double m = 4.7;
System.out.println((int)m); - Answers - The value of m will not change

How many objects are present in the following code fragment?
int x = 7;
String result = ""; - Answers - 1

After the following code fragment is executed:
int x = Integer.parseInt("123 in"); - Answers - An error will take place when the code is
executed.

Which of the following is a high level programming language (Circle all that apply)? -
Answers - a. Java

The expression "cat".equals("dog") evaluates to: - Answers - false

Why do we use .equals for comparisons between String? What is == comparing? -
Answers -

Which of the following correctly generates an integer from 35-51 (inclusive, exclusive)? -
Answers -

What is the largest value that can be represented with 7 bits? - Answers - 256

What is 1110 0011 in base 10? - Answers -

Rachel is confused about the difference between declaring, initializing and instantiating.
Give an example of each below
with a brief description/explanation: - Answers - Declaring:
Initializing:
Instantiating:

What is 200 in base 2? - Answers -

How many objects are present in the following code fragment?
int x = 7;
String result = "";
StringBuffer resultBuff = new StringBuffer("Uhhh");
double y = 22; - Answers - 2

Información del documento

Subido en
10 de julio de 2026
Número de páginas
5
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.09

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
GEEKA
3.8
(361)
Vendido
2137
Seguidores
1449
Artículos
58516
Última venta
2 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes