1Z0-850 Exam Questions
62 real 1Z0-850 exam questions with expert-verified answers and explanations. Page 1 of 2.
- Question #1
Which two are true about stateless session beans? (Choose two.)
- Question #2
Which two are true about javax.swing? (Choose two.)
- Question #3
Given: 18. String s = " abcdcb a "; 19. int x = 2; 20. s = s.trim(); 21. if (s.length() < 8) { 22. x = s.indexOf('c', 3); 23. } 24. System.out.println("x = " + x); What is the resu...
- Question #4
Given: 3. int calc() { 4. long x = 40L; 5. int i = 30; 6. x = w; 7. System.out.println("result is: " + i); 8. } What is the result of calling calc()?
- Question #5
Which is an appropriate description of session beans?
- Question #6
Which is NOT associated with the web tier in a J2EE web-based application?
- Question #7
Click the Exhibit button. Which, inserted at line 3 of the TestDrink class, demonstrates the "program to an interface" principle? 1. interface Drinkable { 2. void drink(); 3. } 1....
- Question #8
Given: Directory structure: projects |__src |__foo |__classes A file Clock.java in the /projects/src/foo directory The working directory /projects/src The class Clock in package fo...
- Question #9
Given concrete class B is a subclass of concrete class A, and class A implements interface C, which two are examples of polymorphism? (Choose two.)
- Question #10
Click the Exhibit button. Which code correctly implements the association between A and B?
- Question #11
What is true about JavaScript clients?
- Question #12
Which is a valid definition of an interface called Transportable given another valid interface, Movable?
- Question #13
Click the Exhibit button. Which class has a superclass relationship?
- Question #14
Which two symbols are used to indicate the visibility of an attribute in UML? (Choose two.)
- Question #15
Which two are valid examples of interface implementation? (Choose two.)
- Question #16
Given: 6. int time = 12; 7. if ( time < 12 ) { 8. System.out.println("Good morning"); 9. } 10. // insert code here 11. System.out.println("Good afternoon"); 12. } 13. else if ( tim...
- Question #17
Which two are true about the relationship "A keyboard has 101 keys."? (Choose two.)
- Question #18
Given: 14. class Dog { 15. String name; 16. public static void main(String [] args) { 17. Dog d1 = new Dog(); 18. Dog d2 = new Dog(); 19. d1.name = "Aiko"; 20. d2.name = "Aiko"; 21...
- Question #19
You have developed a MIDlet that runs on a Java-enabled Personal Digital Assistant (PDA) device. Now, your employer has asked you to port the MIDlet to run on other Java platforms....
- Question #20
Click the Exhibit button. Which two are true? (Choose two.) (Exhibit content: a diagram with 'Fooyo' and 'foo : int = 7')
- Question #21
Given: 17. class B { } Which demonstrates inheritance?
- Question #22
Given: 1. abstract class A { } 2. class B { } 3. interface C { } 4. interface D { } 5. // insert code here Which, inserted at line 5, results in a compilation failure?
- Question #23
Given: 5. // insert code here 6. public abstract void bark(); 7. } 8. // insert code here 9. public void bark() { 10. System.out.println("Woof"); 11. } 12. } 13. } Which, inserted...
- Question #24
Which of the following statements is true?
- Question #25
A J2EE programmer is developing components to encapsulate the business logic in a multitier web-based application. Which J2EE technology is appropriate?
- Question #26
Which two are true about the java and javac commands? (Choose two.)
- Question #27
Which option for javac sets the destination directory for class files?
- Question #28
Given: 1. public class Foo { 2. int size; 3. public static void main(String[] args) { 4. Foo f = new Foo(); 5. f.setSize(5); 6. Foo g = f.go(f); 7. System.out.print(f.size + " : "...
- Question #29
Which two are associated with the web tier in a J2EE web-based application? (Choose two.)
- Question #30
Given: 1. class Test { 2. public static void main(String args[]) { 3. int num1 = 10, num2 = 20, result; 4. result = calc(num1, num2); 5. System.out.println(result); 6. } 7. } 8. //...
- Question #31
Given: 1. public abstract class Wow { 2. private int wow; 3. public Wow(int wow) { 4. this.wow = wow; 5. } 6. public void wow() { } 7. private void wowza() { } 8. } Which is true a...
- Question #32
Given: 1. class X { 2. private Y y; 3. public X(Y y) { this.y = y; } 4. } 5. class Y { 6. private X x; 7. public Y() { } 8. public Y(X x) { this.x = x; } 9. } The instance variable...
- Question #33
Which type of J2EE component is used to store business data persistently?
- Question #34
What is the purpose of JNDI?
- Question #35
Given: 1. class Example { 2. int x = 50; 3. int y = 100; 4. public static void main(String args[]) { 5. int x = 0, y = 10; 6. Example ex = new Example(); 7. while (x < 3) { 8. x++;...
- Question #36
Which statement is true?
- Question #37
Which three are true? (Choose three.)
- Question #38
Which two, about a client's environment, can be determined by an applet? (Choose two.)
- Question #39
A Java developer needs to be able to send email, containing XML attachments, using SMTP. Which J2EE technology provides this capability?
- Question #40
Which two packages are used to create GUI programs in J2SE? (Choose two.)
- Question #41
Which two are benefits when appropriately using polymorphism? (Choose two.)
- Question #42
Which of the following packages are found in the Java Standard Library?
- Question #43
Which diagram best represents the relationship "A Dog has four Legs" based on the definitions of association and composition?
- Question #44
Given: 1. interface Flyer { 2. void takeoff(); 3. boolean land(); 4. } 5. class Airplane implements Flyer { 6. public void takeOff() { /* some code */ } 7. // insert code here 8. r...
- Question #45
Which statement about threading in Java is false?
- Question #46
You need an algorithm that must: - Iterate through an array of primitive integers - Print the value of each array element in index order - If the value of the element is equal to 1...
- Question #47
Given: 1. public enum Color { RED, YELLOW, GREEN } 2. enum Fruit { 3. Banana(Color.RED), 4. Apple(Color.YELLOW), 5. Kiwi(Color.GREEN); 6. private Color color; 7. Fruit(Color color)...
- Question #48
Which two are characteristics of an RDBMS? (Choose two.)
- Question #49
Which statement about java.util is incorrect?
- Question #50
Given: 1. class Exam { 2. private int num = 0; 3. public int getNum() { 4. return num; 5. } 6. } 7. public class Sample { 8. public static void main(String[] args) { 9. Exam e = ne...