+ 3
[ Topic ] How to create objects in Java sololearn.
To create an object, you create a new class in the program like this. class a { void hi() { System.out.println("Hi"); } } public class lol { public static void main(String [] args) { a ha = new a(); ha.hi(); } } This creates a new object in Java.
2 Réponses
+ 6
This is covered by the course...
https://www.sololearn.com/Course/Java/