In this example we will show the method to access class methods with an object in Java.
Source Code
package com.beginner.examples;
public class Message {
public void Info() {
System.out.println("It is good!");
}
public static void main(String[] args) {
Message m = new Message(); // new Message
m.Info(); // access class methods
}
}
Output:
It is good!