Create a class name movie, which describes a movie you can buy at an online movie store. The Movie class has three fields
public class Movie {
String name = "The rock";
int price=10000;
int year =2021;
public static void main(String[] args) {
Main myObj = new Main();
System.out.println("Movie name is: "+myObj.name);
System.out.println("The price of the movie is: "+myObj.price);
System.out.println("Production year is: "+myObj.year);
}
}
Comments
Leave a comment