OCJP(Oracle Certified Java Program)

Totel:20 Click: 1 2 3 4
SCJP1.5 Interview Questions And Answers

Page 1

Strictfp methods use basically as a class modifier, but even we don't need to declare a class as strictfp,

We'll need to have IEEE754 standard : If we need something to help us fall asleep. however, we don't need to know anything about strictfp other than what it's used for, that it can modify a class or non abstract method declaration, and that a variable can never be declared strictfp.

The native modifier basically use for the indication. Its indicate the method is implemented in a platform-dependent language, native can never be combined with abstract, and native can be applied only to methods not classes, not variables, just methods.

Synchronized method is basically a use synchronized keyword.Its indicate the method only 1 time accessed to a thread at a same time.A typical synchronized declaration looks like this :

public synchronized Record retrieveUserInfo(int id) { }

We know that synchronized modifier can be similar as four access control levels  and we can also combine synchronized with final,but never with abstract.

Method argument are basically a type of variable declaration , which is appear in b/w the parenthesis in the method declaration ,A typical method declaration are following as : 

public Record getRecord(int fileNumber, int recordNumber) {}

method argument is similarity as a local variables . in the above code we can see that fileNumber and recordNumber both follows rules of local variables .e can also have a modifier final :

public Record getRecord(int fileNumber, final int recordNumber) {}           

In a final method we use final keyword, its prevents method from being overridden in a subclass, And its used to enforce for API functionality of a method. We have a example the Thread class have a method which is called isAlive() that checks whether a thread is still active.if we would like to extend the thread class , and also we can correctly implement this method themselves.

A typical final method declaration looks like this
class SuperClass{
public final void showSample() {
System.out.println("One thing.");

Goto Page:

1 2 3 4