SLIDE 18 10/6/20 18
Code Style
- Comments at top of program
Ø Sprenkle CSCI209 requirements:
- Must include your name
- Must include high-level description of program
- Proper indentation
Ø Similar to Python Ø Everything within pairs of {} is indented the same
Aug 26, 2020 Sprenkle - CSCI209
35
public public class class Hello { Hello { public public static static void void main(String[] main(String[] args args) { ) { System.out.println("Hello!"); } }
/** * Displays "Hello!" * @author @author Sara Sara Sprenkle Sprenkle */
35
What are the Differences?
Aug 26, 2020 Sprenkle - CSCI209
36
# a Python program def def main(): print("Hello") main()
/** * Our first Java class * @author @author Sara Sara Sprenkle Sprenkle */ public public class class Hello { Hello { public public static static void void main(String[] args) { main(String[] args) { //print a message System.out.println("Hello"); } } 36