DEV Community

Pavitra Aravind
Pavitra Aravind

Posted on

Today class

class Movies
{
static String language = "Tamil";
static boolean new_movie = true;
String hero, heroine, comedian, director, villain, music_director;
int no_of_days;
static int ticket_price;
boolean hit;

public static void main(String[] args)
{
Movies amaran = new Movies();
amaran.hero = "sivakarthikeyan";
amaran.heroine = "sai pallavi";
amaran.music_director = "gvprakash";
amaran.ticket_price = 110;
amaran.no_of_days = 50;
amaran.hit = true;
System.out.println(amaran.hero);
System.out.println(amaran.director);
System.out.println(amaran.comedian);
System.out.println(amaran.villain);

Movies leo = new Movies();
leo.hero = "vijay";
leo.heroine = "trisha";
leo.director = "lokesh";
leo.music_director = "anirudh";
leo.villain = "arjun";
leo.hit = false;
System.out.println(leo.hero);
System.out.println(leo.hit);
System.out.println(leo.no_of_days);

amaran.watch();

}
public void watch()
{
System.out.println("Inside watch() method " + hero);
}

}

Output:

Image description

Top comments (0)