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
Document preview thumbnail
Preview 4 out of 32 pages
Exam (elaborations)

PRO 192 Latest Exam All Questions Answered Correctly 2025/2026 Updated.

Document preview thumbnail
Preview 4 out of 32 pages

The default value of a static integer variable of a class in Java is, (a) 0 (b) 1 (c) Garbage value (d) Null (e) -1. - Answer A What will be printed as the output of the following program? public class testincr { public static void main(String args[]) { int i = 0; i = i++ + i; Sln("I = " +i); } } (a) I = 0 (b) I = 1 (c) I = 2 (d) I = 3 (e) Compile-time Error. - Answer B Multiple inheritance means, (a) one class inheriting from more super classes (b) more classes inheriting from one super class (c) more classes inheriting from more super classes (d) None of the above (e) (a) and (b) above. - Answer A

Content preview

PRO 192 Latest Exam All Questions
Answered Correctly 2025/2026
Updated.
The default value of a static integer variable of a class in Java is,

(a) 0

(b) 1

(c) Garbage value

(d) Null

(e) -1. - Answer A



What will be printed as the output of the following program?

public class testincr

{

public static void main(String args[])

{

int i = 0;

i = i++ + i;

System.out.println("I = " +i);

}

}

(a) I = 0

(b) I = 1

(c) I = 2

(d) I = 3

(e) Compile-time Error. - Answer B



Multiple inheritance means,

(a) one class inheriting from more super classes

(b) more classes inheriting from one super class

(c) more classes inheriting from more super classes

(d) None of the above

(e) (a) and (b) above. - Answer A

,Which statement is not true in java language?

(a) A public member of a class can be accessed in all the packages.

(b) A private member of a class cannot be accessed by the methods of the same class.

(c) A private member of a class cannot be accessed from its derived class.

(d) A protected member of a class can be accessed from its derived class.

(e) None of the above. - Answer B



To prevent any method from overriding, we declare the method as,

(a) static

(b) const

(c) final

(d) abstract

(e) none of the above. - Answer C



Which one of the following is not true?

(a) A class containing abstract methods is called an abstract class.

(b) Abstract methods should be implemented in the derived class.

(c) An abstract class cannot have non-abstract methods.

(d) A class must be qualified as 'abstract' class, if it contains one abstract method.

(e) None of the above. - Answer C



The fields in an interface are implicitly specified as,

(a) static only

(b) protected

(c) private

(d) both static and final

(e) none of the above. - Answer D



What is the output of the following program:

public class testmeth

{

static int i = 1;

public static void main(String args[])

{

System.out.println(i+" , ");

,m(i);

System.out.println(i);

}

public void m(int i)

{

i += 2;

}

}

(a) 1 , 3

(b) 3 , 1

(c) 1 , 1

(d) 1 , 0

(e) none of the above. - Answer C



Which of the following is not true?

(a) An interface can extend another interface.

(b) A class which is implementing an interface must implement all the methods of the interface.

(c) An interface can implement another interface.

(d) An interface is a solution for multiple inheritance in java.

(e) None of the above. - Answer C



Which of the following is true?

(a) A finally block is executed before the catch block but after the try block.

(b) A finally block is executed, only after the catch block is executed.

(c) A finally block is executed whether an exception is thrown or not.

(d) A finally block is executed, only if an exception occurs.

(e) None of the above. - Answer C



Among these expressions, which is(are) of type String?

(a) "0" (b) "ab" + "cd"

(c) '0'

(d) Both (A) and (B) above (e) (A), (B) and (C) above. - Answer d



Consider the following code fragment

Rectangle r1 = new Rectangle();

, r1.setColor(Color.blue);

Rectangle r2 = r1;

r2.setColor(Color.red);



After the above piece of code is executed, what are the colors of r1 and

r2 (in this order)?

(a) Color.blue

Color.red

(b) Color.blue

Color.blue

(c) Color.red

Color.red

(d) Color.red

Color.blue

(e) None of the above. - Answer c



What is the type and value of the following expression? (Notice the integer division)

-4 + 1/2 + 2*-3 + 5.0

(a) int -5 (b) double -4.5

(c) int -4

(d) double -5.0 (e) None of the above. - Answer d



What is printed by the following statement?

System.out.print("Hello,\nworld!");

(a) Hello, \nworld!

(b) Hello, world!

(c)

(d) "Hello, \nworld!"

(e) None of the above. - Answer c



Consider the two methods (within the same class)

public static int foo(int a, String s)

{

s = "Yellow";

a=a+2;

Document information

Uploaded on
March 14, 2026
Number of pages
32
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

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

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
3.5
(167)
Sold
959
Followers
128
Items
30809
Last sold
1 day ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions