1 / 6

CSE115: Introduction to Computer Science I

CSE115: Introduction to Computer Science I. Dr. Carl Alphonce 343 Davis Hall 645-4739 alphonce@buffalo.edu. Agenda. Announcements Cell phones / laptops off & away / Name signs out Last time main method import directive java.lang package System.out.println

arav
Download Presentation

CSE115: Introduction to Computer Science I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall 645-4739 alphonce@buffalo.edu

  2. Agenda • Announcements • Cell phones / laptops off & away / Name signs out • Last time • main method • import directive • java.lang package • System.out.println • Observer pattern for event handling • Today • @override • comments (// and /* */) • example code (see repo)

  3. Announcements • Exam 2 • covers material from exam 1 up to & including today • review on Monday 10/22 • exam on Wednesday 10/24 • No recitations in exam week: 10/22 – 10/26

  4. @Override • @Override is an annotation • The @Override annotation indicates that a method is defined to satisfy a specification given in a supertype. • Example: @Override public void actionPerformed(ActionEvent e) { … } • Without the @Override annotation the compiler will issue a warning; the compiler wants to know that the developer knows that a given method definition satisfies a requirement specified in a supertype, and that definition of the method was not accidentally the same as a supertype specification.

  5. comments • Comments are parts of a source code file which are ignored by the compiler • Comments are used to document code for human readers • Java has two basic types of comments • in-line comments: anything from the characters ‘//’ (including these characters) to the end of a line is ignored as a comment private String _x; // _x holds a description of this object • block comments: anything between the characters ‘/*’ and the characters ‘*/’ (including these characters) is ignored as a comment /* The variable _x holds * a description of this * object. */ private String _x;

  6. example code Check out the ‘SwingExamples’ project in the course’s code repository: • Host: timberlake.cse.buffalo.edu • Repository path: /projects/CSE115/Repositories/Fall2012/Student • Connection type: extssh

More Related