The document contains a simple Java program with two classes: 'con' and 'Main1'. The 'con' class has a method 'subject' that prints 'subject is java', and the 'Main1' class contains the main method which creates an anonymous object of 'con' to call the 'subject' method and prints 'anonemous object'. Overall, it demonstrates the use of an anonymous object in Java.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views1 page
Practice Java With CMD
The document contains a simple Java program with two classes: 'con' and 'Main1'. The 'con' class has a method 'subject' that prints 'subject is java', and the 'Main1' class contains the main method which creates an anonymous object of 'con' to call the 'subject' method and prints 'anonemous object'. Overall, it demonstrates the use of an anonymous object in Java.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
class con
{ public void subject() { [Link]("subject is java"); } } class Main1 { public static void main(String[] args) { new con().subject(); [Link]("anonemous object"); } }