Object


In object-oriented programming (OOP), objects are instances of a class and can be considered real-life entities with a state and behavior.

Object sample code
package in.ihelpyou;

public class Calc {

	public int n1, n2;

	public int multiply() {
		return n1 * n2;
	}

	public static void main(String[] args) {

		Calc myObject = new Calc();

		myObject.n1 = 6;
		myObject.n2 = 5;

		int ans = myObject.multiply();

		System.out.println("Multiplied value: " + ans);

	}

}