Access over 20 million homework & study documents

search

Exam 803 sample questions

Content type
User Generated
Rating
Showing Page:
1/4

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/4

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/4

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 4 pages?
Access Now
Unformatted Attachment Preview
Exam 803 – Sample Questions 1. Given: public class Calculator { int num = 100; public void calc(int num) { this.num = num * 10; } public void printNum(){ System.out.println(num); } public static void main(String[] args) { Calculator obj = new Calculator (); obj.calc(2); obj.printNum(); } } What is the result? A) 20 B) 100 C) 1000 D) 2 2. Given: public class MyStuff { String name; MyStuff(String n) { name = n; } public static void main(String[] args) { MyStuff m1 = new MyStuff("guitar"); MyStuff m2 = new MyStuff("tv"); System.out.println(m2.equals(m1)); } public boolean equals(Object o) { MyStuff m = (MyStuff) o; if (m.name != null) { return true; } return false; } } What is the result? A) The output is true and MyStuff fulfills the Object.equals() contract. B) The output is false and MyStuff fulfills the Object.equals() contract. C) The output is true and MyStuff does NOT fulfill the Object.equals() contract. D) The output is false and MyStuff does NOT fulfill the Object.equals() contract. 3. Given: import java.util.*; public class App { public static void main(String[] args) { List p = new ArrayList(); p.add(7); p.add(1); p.add(5); p.add(1); p.remove(1); System.out.println(p ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Awesome! Made my life easier.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Documents