Simple Program on Class in Java || Lesson 37 || Java Programming || Learning Monkey ||

Описание к видео Simple Program on Class in Java || Lesson 37 || Java Programming || Learning Monkey ||

Simple Program on Class in Java
In this class, We discuss Simple Programs on Class in Java.
The reader should have prior knowledge of the class and object. Click Here.
This a simple example to understand the concepts we discussed in previous classes.
The reader should take the question and write the code for best practice.
Question:
Write a Java program to find the area and perimeter of a rectangle.
The below diagram shows the code.
The area of a rectangle is length * width.
The perimeter of a rectangle is 2*(length + width)
Both the above need length and width.
We consider length and width as instance variables.
The area is one logic, so consider it as a method.
Similarly, consider the perimeter method.

Link for playlists:
   / @learningmonkey  


Link for our website: https://learningmonkey.in

Follow us on Facebook @   / learningmonkey  

Follow us on Instagram @   / learningmonkey1  

Follow us on Twitter @   / _learningmonkey  

Mail us @ [email protected]

Комментарии

Информация по комментариям в разработке