Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE110 Lecture 03

CSE110 Lecture 03

Principles of Programming with Java
Classes, methods, and variables
(202005)

B546a9b97d993392e4b22b74b99b91fe?s=128

Javier Gonzalez

May 19, 2017
Tweet

Transcript

  1. CSE110 Principles of Programming with Java Lecture 03: Classes, methods,

    and variables Javier Gonzalez-Sanchez javiergs@asu.edu javiergs.engineering.asu.edu | javiergs.com Office Hours: By appointment
  2. IDE Using Eclipse

  3. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 3 Previously…

  4. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 4 Previously…

  5. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 5 Previously…

  6. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 6 Previously…

  7. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 7 Previously…

  8. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 8 Previously…

  9. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 9 Previously…

  10. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 10 Previously…

  11. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 11 Previously…

  12. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 12 Previously…

  13. IDE Using IntelliJ

  14. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 14 Previously…

  15. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 15 Previously…

  16. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 16 Previously…

  17. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 17 Previously…

  18. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 18 Previously…

  19. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 19 Previously…

  20. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 20 Previously…

  21. IDE Using TutorialsPoint.com

  22. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 22 Previously…

  23. Java Classes, Methods and Variables

  24. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 24 Previously…

    and static public class TheClassName { } public static void theFirstMethodName() { } public static void secondMethodName() { } // instructions go here // instructions go here // variables go here // variables go here // variables go here
  25. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 25 Example

    without main()
  26. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 26 main()

    method • All programs should have one and only one main() method. • Trying to execute a class without a main() method generates a compilation error
  27. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 27 Previously…

    and static public class TheClassName { } public static void theFirstMethodName() { } public static void secondMethodName(){ } // instructions go here // instructions go here // variables go here // variables go here // variables go here public static void main( ) { } // instructions go here // variables go here
  28. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 28 Example

    with main()
  29. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 29 Example

    main() calling methods
  30. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 30 Template

    public class TheClassName { } public static void theFirstMethodName() { } public static void secondMethodName(){ } // instructions go here // instructions go here // variables go here // variables go here // variables go here public static void main( ) { } // instructions go here // variables go here
  31. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 31 Global

    Variable
  32. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 32 Error

  33. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 33 Homework

    Read Sections 2.1, 2.2, and 2.3
  34. CSE110 - Principles of Programming Javier Gonzalez-Sanchez javiergs@asu.edu Summer 2020

    Disclaimer. These slides can only be used as study material for the class CSE110 at ASU. They cannot be distributed or used for another purpose.