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
pixel
B
boolean
C
integer
D
floating point
E
enumerated type
Ans-D
Q.2 Which two are required for proper information hiding? (Choose two.) A
All attributes must be marked with hidden.
B
All attributes must be marked with private.
C
Internal methods must be marked with hidden.
D
Internal methods must be marked with private.
E
All attributes must be given public accessor and mutator methods.
F
All attributes must be given exposed accessor and mutator methods.
Ans – B,D
Q.3 Click the Exhibit button. a----b Which two are true? (Choose two.) A
The multiplicity on the endpoint for class B is undefined.
B
The multiplicity on the endpoint for class B is implicitly one.
C
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
float var = 100.0;
B
float var = 100.0F;
C
var : float = 100.0;
D
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
z=x-y
B
z = x.remove(y)
C
z = x.substract(y)
D
z = x.replace(y, "")
Ans- D Q.7 Which package contains APIs that are useful for distributed programming and communication? A
java.awt
B
java.net
C
java.util
D
javax.swing
Java SE API documentation.
Ans- B Q.8 Click the Exhibit button.
A
SQL
B
HTTP
C
JDBC
D
RDBMS
E
Java Beans
F
Entity Beans
Ans A,D
Q.9 Which two types of applications are appropriate for J2ME? (Choose two.) A
games
B
word processing
C
remote data collection
D
air traffic control system
Ans A,C Q.10 Which describes the role of servlet developer? A
a Java programmer who creates programs that execute on cell phones
B
a Java programmer who creates classes that respond to HTTP requests
C
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