A package statement must appear as the first line in a source code file (excluding blanklines and comments).
Latest Answer : package statement must appear as the first line in a source code file and one public class declaration. ...
Yes, a for statement can loop indefinitely. For example, consider the following:for(;;) ;
Latest Answer : The for loop will be working fine even without the initialization.Hence for(;;) will create a indefinite loop. ...
If a checked exception may be thrown within the body of a method, the method musteither catch the exception or declare it in its throws clause.
Latest Answer : this rule is actually for handling the exceptions:that is there are two ways by ehich u can handle the exception :1:either you use the try catch statement and enclose the appropriate code in the try catch block,this is called as the catch or the HANDLE ...
After a thread is started, via its start() method or that of the Thread class, the JVMinvokes the thread's run() method when the thread is initially executed.
Latest Answer : when its start() method is called ...
The finally clause is used to provide the capability to execute code no matter whether ornot an exception is thrown or caught.
Latest Answer : In try,catch clauses either try clause(If exception is not happend) or catch clause(If exception occures) is exicuted.If we want to exicute a block of statements doesn't depend on exception then we put those block of statements in finally ...
A break statement results in the termination of the statement to which it applies (switch,for, do, or while). A continue statement is used to end the current loop iteration andreturn control to the loop
Latest Answer : The break keyword halts the execution of the current loop and forces control out of the loop. The continue is similar to break, except that instead of halting the execution of the loop, it starts the next iteration. ...
It must provide all of the methods in the interface and identify the interface in itsimplements clause.
Latest Answer : interface enhance the concepts of inheritence. by calling multiple interfaces to class we can also inherinting more than a class indirectly ...
Commas are used to separate multiple statements within the initialization and iterationparts of a for statement.
If a thread attempts to execute a synchronized method or synchronized statement and isunable to acquire an object's lock, it enters the waiting state until the lock becomesavailable.
A catch clause can catch any exception that may be assigned to the Throwable type. Thisincludes the Error and Exception types.