# SCJA SAMPLE QUESTIONS BY SUN MICROSYSTEM

Q.1 You are creating a space flight simulation for a start-up aeronautics company. This simulation program must calculate the orbital mechanics and display the flight path on a graphics screen. What type of data is most appropriate for calculating the orbital mechanics equations? A B C D E Ans-D pixel boolean integer floating point enumerated type

Q.2 Which two are required for proper information hiding? (Choose two.) A B C D E F Ans – B,D All attributes must be marked with hidden. All attributes must be marked with private. Internal methods must be marked with hidden. Internal methods must be marked with private. All attributes must be given public accessor and mutator methods. All attributes must be given exposed accessor and mutator methods.

Q.3 Click the Exhibit button. a----b Which two are true? (Choose two.) A B C The multiplicity on the endpoint for class B is undefined. The multiplicity on the endpoint for class B is implicitly one. The arrow between class A and class B is an inheritance relationship.

D

An instance of class A will have a means to navigate to an instance of class B.

Ans- A Q.4 Click the Exhibit button.

A class MyClass { - x : int; - y : int; + z : int; - ch : char; + vel : float; + acc : float; } B class MyClass { private x : int; private y : int; public z : int; private ch : char; public vel : float; public acc : float; }

C class MyClass { - int x; - int y; + int z; - char ch; + float vel; + float acc; } D class MyClass { private int x; private int y; public int z; private char ch; public float vel; public float acc; } E class MyClass { private: int x; int y; char ch; public: int z; float vel; float acc;

} Ans- D Q.5 Which statement declares a floating point variable and assigns it the initial value of 100? A B C D float var = 100.0; float var = 100.0F; var : float = 100.0; var : float = 100.0F;

Ans-B

Q.6 Given: x = "abcedfghijklmnopqrstuvwxyz" y = "lmno" Which line of code will remove the y string from the x string, and store it in the z variable? A B C D Ans- D Q.7 Which package contains APIs that are useful for distributed programming and communication? A B C D java.awt java.net java.util javax.swing z=x-y z = x.remove(y) z = x.substract(y) z = x.replace(y, "")

Java SE API documentation.

Ans- B Q.8 Click the Exhibit button.

A B C D E F

SQL HTTP JDBC RDBMS Java Beans Entity Beans

Ans A,D

Q.9 Which two types of applications are appropriate for J2ME? (Choose two.) A B C D games word processing remote data collection air traffic control system

Ans A,C Q.10 Which describes the role of servlet developer? A B C a Java programmer who creates programs that execute on cell phones a Java programmer who creates classes that respond to HTTP requests a web designer who generates dynamic web pages to create user interfaces

D a Java programmer who creates components that represent data in a relational database Ans - B