OCJP(Oracle Certified Java Program)



Totel:39 Click: 1 2 3 4 5 6 7 8
scjp1.5 Interview Questions And Answers

Page 4

Scope is basically refers  to the life time of a variable. here we know that its have a mainly four basic scopes which is following here : 
  1. static variables live basically as long as their class lives.
  2. instances variable live as long as their object lives.
  3. local variable live as long as their method is on the stack; however ,if their method invokes another method.they are temporarily unavailable.
  4. block variables live until the block completes.

Literals basically many types are their but right now we can see that Integer literals can be decimal , its also can be octal for the example 013 or its can be see also in the hexadecimal for the example 0x3d.its only for the longs end L or 1.this is only for the Float literals for the end in F to f, and we use the literals end in a digit or D or d.int he boolean case we can see that true and false.and the Literals for the chars are a single charterer inside single quotes 'd'.

stack basically use for the Local variable its a mainly method variable its live on the stack.in the Heap case we know that its a type of object their instances variables live on the heap .

coupling refers tot he degree to which one class knows about or uses members of another class.its loose coupling is the desirable state of having classes that are well encapsulated minimize references to each there.tight coupling is the undesirable state of having classes that break the rules of loose coupling.

static method basically for the implement behavior that are not affected by the state of any instance.here only one value of the static variable.this method is cant access an instance variable directly. Its method also not overridden but they ca be redefined.


Goto Page:

1 2 3 4 5 6 7 8