describe the class or static members a method or


Describe the Class or static Members ?

A method or a field in a Java program could be declared static. That means the member belongs to the class rather than to an individual object.

If a variable is static, then while any object in the class changes the value of the variable, that value modifies for all objects in the class.
For instance, suppose the Car class contained a speedLimit field which was set to 112 kph (70 mph). This would be the similar for all cars. If it changed (by act of Congress) for one car, it would have to change for all cars. This is a classical static field.

Methods are frequent static is if they neither access nor modify any of the instance (non-static) fields of a class and they do not invoke any non-static techniques in the class. This is general in calculation methods such as a square root method that merely operates on their arguments and returns a value. One way of thinking of it is that techniques should be static if it neither uses nor requires to use this.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: describe the class or static members a method or
Reference No:- TGS0284743

Expected delivery within 24 Hours