answersLogoWhite

0

A static block is a code block defined with the 'static' keyword and is not inside others blocks.

The static block is executed when the class is first loaded and the main purpose is perform all the initialization that may not be appropriate inside a constructor.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

In which direction is the static friction force acting on block 1?

The static friction force on block 1 is acting in the opposite direction of the force applied to it.


What is the format of java file?

Class Ram { static {} //static block to execute something before main method Ram() //constructor {} {} //init block public static void main(String ss[]) { } other methods }


What is a static identifier?

A static identifier in a block has execution time lifespan, i.e. its value persists from point of initialization to program termination.A static identifier outside of any block has execution time lifespan, because of its non-block semantics, but the static attribute takes on a different meaning, and means that it is not visible to modules outside of the file it is defined in.(Only applicable to C++ - answer provided for completeness sake) A static identifier in a class is common to all instances of that class. A static method of a class can access only static identifiers of that class.


Static variable in c?

A static variable in C is one in which the memory is preallocated before the execution unit begins and lasts for the entire program unit.A non-static variable in C will be allocated in the block in which it is contained, and destroyed outside that block.


Will anti static bag block gps signal?

No, an anti-static bag will not block GPS signals. GPS signals are radio waves that can pass through materials like plastic and cloth, so they will not be obstructed by the anti-static bag.


Which one executed first static block or static methods in java?

Static Blocks are always executed first. A static block is executed when your class is charged but a static method is executed only when is called, therefor first the class is charged and then is executed a method.


A 5.0 kg wooden block is placed on an adjustable wooden inclined plane. What is the angle of incline above which the block will start to slide down the plane .57?

mgsin (theta) - (static) mu * mgcos(theta) = 0 rearrange the equation and cancal mg therefore, tan ( theta) = mu (static) theta = arctan (static mu) If the static coefficient is 0.57, then theta = arctan (0.57) theta = 29.7 degree Note: from the equation, the mass of the block is independent to the angle. Whether you have a bigger block or smaller block, it will start sliding @ 29.7 degree.


Horizontal force required to pull 75 kg block?

To pull a 75 kg block horizontally, you need to overcome the force of static friction between the block and the surface it's on. The force required would depend on the coefficient of static friction between the block and the surface. You can calculate it using the formula: Force of friction = coefficient of static friction × normal force.


A block of wood is at rest on a wooden ramp. When wheels are attached to the block of wood it moves down the ramp. Explain each situation in terms of friction.?

In the first situation without wheels, the block of wood is at rest due to static friction between the wood surfaces of the block and the ramp, which resists motion. When wheels are attached, rolling friction replaces static friction, allowing the block to move more easily down the ramp since rolling friction is typically lower than static friction.


A blocks weight is 36.0 N rests on horizontal table A horizontal f. of 42 N is applied to the block coefficients of static and kinetic fric are 0.650 and 0.420 resp Will the block move under force?

In order for the block to move the force applied has to be greater than the maximum force of static friction. F > fs fs = coefficient of friction * normal force = .65 * 36N // you can use the weight for the normal force since the block is being supported = 23.4N Since applied force of 42N is greater than the 23.4N due to friction, the block will start sliding, where kinetic friction will act on the block.


Can you print some message on the console without using main in java?

By using the static block


Where the static variables are stored?

initialize static variables are stored in data segment where uninitialized static variables are stored in BSS(block storing for Symbol) it also a part of data segment exp static int i=10;//stored in data segment static int i;//stored in BSS (uninitialized data segment) Thanks NAvin