Definition of MVC in java

MVC stands for Model-View-Controller. It’s a way of designing an application that separates data access, business logic and the graphical user interface. The goal is to make the application more maintainable. The Model refers to the data and how it is handled, the View presents the data to the user and the Controller interprets the user’s interactions with the View into changes to the Model. In practice the Java implementation of this design focuses on separating the data access and business logic from the GUI.
A simple example is an application that converts meters into kilometers. The Model would be a class that handles the conversion calculation. The View would be a GUI made up of a text field that takes in a value for meters, a label that displays the value in kilometers and a button to press for the conversion. The Controller would be the button listener. Once the button is clicked it gives the Model the value in meters and provides the answer in kilometers to the View. Typically the View and the Controller will be in the same class as it’s simpler to combine them.