java:defining_classes_in_java
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
java:defining_classes_in_java [2020/09/12 02:51] – [Our first Java class] mithat | java:defining_classes_in_java [2020/09/12 02:56] – [Where does the definition go?] mithat | ||
---|---|---|---|
Line 47: | Line 47: | ||
==== Where does the definition go? ==== | ==== Where does the definition go? ==== | ||
+ | === The easy-for-beginners way === | ||
+ | If there' | ||
+ | |||
+ | <file java ClickerCounter.java> | ||
+ | tbd | ||
+ | </ | ||
+ | |||
+ | This isn't generally recommended though because very often you will write more than one custom class in your program. | ||
+ | |||
+ | === The better way === | ||
In Java, class definitions need to go in their own files, and the files need to be called the name of the class with the '' | In Java, class definitions need to go in their own files, and the files need to be called the name of the class with the '' |
java/defining_classes_in_java.txt · Last modified: 2020/09/14 01:38 by mithat