What are blocks?.
blocks is a group of single and compound statements
between the braces { }
class Amit
{
Amit()
{
Sysem.out.println("constructor");
}
{//begin block instance itializer block
System.out.prinln("amit");
}//end the block
psvm(String [] args)
{
boolean b=true;
if(b)
{//begin block
System.ou.println("boolean");
}//end of block
.
.
.//crete objec in psvm
.
| Is This Answer Correct ? | 2 Yes | 0 No |
Explain the difference between private, public, package and protected in java?
What are accessor methods in java?
What is method Overloading in the perspective of OOPS?
Can a class be subclass of itself?
Can each java object keep track of all the threads that want to exclusively access it?
Is string pool garbage collected?
What is the difference between array list and vector in java?
What are the two ways you can synchronize a block of code?
Explain about map interface in java?
What is a programming object?
How can I right-justify a string?
Why for each loop is used?