Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
77
Grade
A+
Uploaded on
15-03-2026
Written in
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

Show more Read less
Institution
PRO 192 FULL
Course
PRO 192 FULL

Content preview

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

}

}

Written for

Institution
PRO 192 FULL
Course
PRO 192 FULL

Document information

Uploaded on
March 15, 2026
Number of pages
77
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$14.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Thumbnail
Package deal
PRO 192 FULL EXAM PACKAGE DEAL BUNDLE 2025/2026 UPDATE !!
-
13 2026
$ 189.37 More info

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TestSolver9 Webster University
View profile
Follow You need to be logged in order to follow users or courses
Sold
838
Member since
2 year
Number of followers
126
Documents
27556
Last sold
1 day ago
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 reviews

5
67
4
19
3
25
2
12
1
28

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions