By Andrew Zimmerman Jones. Definition: Velocity is a vector measurement of the rate and direction of motion or, in other terms, the rate and direction of the change in the position of an object.The scalar (absolute value) magnitude of the velocity vector is the speed of the motion.In calculus terms, velocity is the first derivative of position with respect to time. The most common way to calculate the constant velocity of an object moving in a straight line is with the formula:elocity is a vector measurement of the rate and direction of motion or, in other terms, the rate and direction of the change in the position of an object.
Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as as single unit.elow given is an example that demonstrates how to achieve Encapsulation in Java: The public setXXX() and getXXX() methods are the access points of the instance variables of the EncapTest class.
In encapsulation the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class, therefore it is also known as data hiding. To achieve encapsulation in Java. Declare the variables of a class as private.elow given is an example that demonstrates how to achieve Encapsulation in Java: The public setXXX() and getXXX() methods are the access points of the instance variables of the EncapTest class.