Java Syntax, Java Conventions, CSE 115 Conventions (Part 1) - PowerPoint PPT Presentation

About This Presentation
Title:

Java Syntax, Java Conventions, CSE 115 Conventions (Part 1)

Description:

All files that contain Java source code have a .java extension ... Each file contains one (and only one) class definition. All Java code must exist inside of a class ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 9
Provided by: cseBu
Learn more at: https://cse.buffalo.edu
Category:

less

Transcript and Presenter's Notes

Title: Java Syntax, Java Conventions, CSE 115 Conventions (Part 1)


1
Java Syntax, Java Conventions, CSE 115
Conventions (Part 1)
  • CSE 115
  • Spring 2006
  • January 25 27, 2006

2
I - Java Files
  • All files that contain Java source code have a
    .java extension
  • Code that has been compiled (using the compiler
    javac) will be turned into byte code and stored
    in files with a .class extension
  • Run the files with the java command to execute
    the program.

3
I Java Files
  • The process of creating files is often called the
    edit-compile-run cycle as the steps are
  • Create/edit your source code
  • Compile the code
  • Run the program to see if it works
  • If it doesnt work correctly, go back to step 1

4
II Java Syntax
  • Java is case sensitive (as is UNIX)
  • The words
  • excellent
  • Excellent
  • are seen as different by Java
  • Java is also an extremely consistent speller.

5
III Names of Java Files
  • Match the names of the classes defined in those
    files
  • Each file contains one (and only one) class
    definition
  • All Java code must exist inside of a class

6
IV Identifying the class
  • Class definitions begin at the word public and
    end at a that matches a that follows the name
    of the class.
  • public class SomeName
  • Between the is the Java code that outlines
    what the functionality of the class is.

7
V Class vs. Object
  • Class formal specification (definition)
  • Object actual instance
  • We need to represent properties and capabilities
    formally, what programming constructs do we use
    to do this?

8
VI Where does the program start?
  • Q How do you get your program to run in Eclipse?
  • Q What are the two types of Java programs and
    what are their differences?
  • Program starts with the first line of the
    Applets constructor.
Write a Comment
User Comments (0)
About PowerShow.com