0

I have a main method in one public class called "Dated" that looks like this

public static void main (String args[]) throws ParseException

Now I want to call this main method in another class called "Puzzle2" and in another method static void edit;

How can I do so?

1 Answers1

0

Strictly avoid Calling main ; its not best practice to code like that .

And btw the main is a static method you can't create object and call it

instead change your main into a function dated() and use different class file for main .

So that u can call the dated () function with instances of classes whenever you want.

mohanen b
  • 116
  • 13