Using Multiple Classes

Learn How to Use Multiple Classes in Java

MainClass

public class Demo {
public static void main(String args[]) {

NewOne newOneObject = new NewOne();

newOneObject.simpleMessage();
}

}

NewOne Class

public class NewOne {
public void simpleMessage(){
System.out.println(“Hello malik himani”);
}
}

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.