I want to write a class with three int values in them and manipulate them in main();
There are two ways I can think of doing this
- Have a seperate .class file and include it into another class file containint the main() function
stuff.java:
class stuff { ... }
class app {
public static void main(String[] arguments) {
.. // manipulate the instance variables
}
}
2 have the class and then a class containint the main function in the same file app.java
app.java:
class stuff { ... }
class app {
public static void main(String[] arguments) {
.. // manipulate the instance variables
}
}
Are these the main ways it is done in java ( I didn’t see anything on including java classes ). Or can I make the stuff class contain main itself?
I am wondering, if you want to write a class with three int values in them and manipulate them in main() method just do it! Why do you need some
staffclass ?