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
Examen

PRO192 - FE - Spring2020 Test Questions with Correct/Verified Solutions.

Puntuación
-
Vendido
-
Páginas
77
Grado
A+
Subido en
15-03-2026
Escrito en
2025/2026

Q1. what is the output when the following program is run? class A {public int x;} public class Main {static void fun(A t) {t.x += 2;} public static void main(String args[]) {A t = new A(); t.x = 99; S(t.x + " "); t.x++; S(t.x + " "); fun(t); S(t.x); } } A. 98 99 101 B. 99 99 101 C. D. E. - Answer E a programmer need to create a logging method that can accept an arbitrary number of argument. For example, it may be called in these ways: loglt("log message 1"); loglt("log message 2","log message 3"); loglt("log message 4","log message 5","log message 6"); which declaration satisfies this requirement? A. public void loglt(String... msgs) B. public void loglt(String[] msgs) C. public void loglt(String * msgs) D. public void loglt(String msgs1, String msgs2, String msgs3) - Answer A

Mostrar más Leer menos
Institución
PRO 192 FULL
Grado
PRO 192 FULL

Vista previa del contenido

PRO192 - FE - Spring2020 Test
Questions with Correct/Verified
Solutions.
Q1. what is the output when the following program is run?

class A {public int x;}

public class Main

{static void fun(A t) {t.x += 2;}

public static void main(String args[])

{A t = new A();

t.x = 99;

System.out.print(t.x + " ");

t.x++;

System.out.print(t.x + " ");

fun(t);

System.out.print(t.x);

}

}

A. 98 99 101

B. 99 99 101

C. 99 100 100

D. 99 100 101

E. 99 100 102 - Answer E



a programmer need to create a logging method that can accept an arbitrary number of
argument. For example, it may be called in these ways:

loglt("log message 1");

loglt("log message 2","log message 3");

loglt("log message 4","log message 5","log message 6");

which declaration satisfies this requirement?

A. public void loglt(String... msgs)

B. public void loglt(String[] msgs)

C. public void loglt(String * msgs)

D. public void loglt(String msgs1, String msgs2, String msgs3) - Answer A

,1 answer



given the following class definition

public class Upton{

public static void main(String args[]){

}

public void amethod(int i){}

//here

}

Which of the following would be illegal to place after the comment //here?

A. private void anothermethod(){}

B. public int amethod(int z){}

C. public int amethod(int i,int j){return 99;}

D. protected void amethod(long l){} - Answer B



what will happen when you attempt to compile and run the following code

import.java.io.*;

class Base{

public void amethod()throws FileNotFoundException{}

}



public class ExcepDemo extends Base{

public static void main(String args[]){

ExcepDemo e = new ExcepDemo();

}

public void amethod(){}

protected ExcepDemo(){

try{

DateInputStream din = new DataInputStream(System.in);

System.out.print(t"Pausing");

din.readByte();

System.out.print("Continuing");

this.amethod();

}catch(IOException ioe) {}

,}

}

A. Compile time error caused by protected constructor

B. Compile and run with output of "Pausing" and "Continuing" after a key is hit

C. Compile time error caused by amethod not declaring Exception

D. Runtime error caused by amethod not declaring Exception - Answer B



1 answer



Will this following code compile?

try{

} catch (Exception e) {

} catch (ArithmeticException a) {

}

A. This code will compile

B. This code will not compile - Answer B



In order for objects in a List to be sorted, those objects must implement which interface
method?

A. Comparable interface its compare method

B. Comparable interface its compareTo method

C. Comparable interface its equals method

D. Compare interface its compareTo method - Answer B



1 answer



public class Person {

int age;

String name;



public Person() {

this("Peter");

System.out.print("first ");

}

, public Person(String name) {

this(42, "Peter");

System.out.printf("second ");

}



public Person(int age, String name) {

this.age = age;

this.name = name;

System.out.printf("third ");

}



public static void main(String args[]){

Person b = new Person();

System.out.printf(b.name +" " + b.age);

}

}

What is the result?

A. Peter 42 third second first

B. third second first Peter 42

C. first second third Peter 42

D. third first second Peter 42

E. Peter 42 first second third - Answer B



1 answer



What is the output when you try to compile and run the following program?



public class Main{

void f(String t) {System.out.printfln("String");}

void f(StringBuffer h) {System.out.printfln("StringBuffer");}

public static void main(String argv[]){

f("ABC");

System.out.printfln();

}

}

Escuela, estudio y materia

Institución
PRO 192 FULL
Grado
PRO 192 FULL

Información del documento

Subido en
15 de marzo de 2026
Número de páginas
77
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$14.99
Accede al documento completo:

¿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


Documento también disponible en un lote

Conoce al vendedor

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.
TestSolver9 Webster University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
838
Miembro desde
2 año
Número de seguidores
126
Documentos
27556
Última venta
1 día hace
TESTSOLVER9 STORE

TOPNOTCH IN LEARNING MATERIALS,(EXAMS,STUDYGUIDES NOTES ,REVIEWS,FLASHCARDS ,ALL SOLVED AND PACKAGED.OUR STORE MAKE YOUR EDUCATION JOURNEY EFFICIENT AND EASY.WE ARE HERE FOR YOU FEEL FREE TO REACH US OUT .

3.6

151 reseñas

5
67
4
19
3
25
2
12
1
28

Documentos populares

Recientemente visto por ti

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