Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fundamentals of Software Development 1Slide 1 Today’s Summary Things, types and names – –What are names? types? – –Why use names? – –How to use a name:

Similar presentations


Presentation on theme: "Fundamentals of Software Development 1Slide 1 Today’s Summary Things, types and names – –What are names? types? – –Why use names? – –How to use a name:"— Presentation transcript:

1 Fundamentals of Software Development 1Slide 1 Today’s Summary Things, types and names – –What are names? types? – –Why use names? – –How to use a name: Declare it Assign it a value Refer to it in an expression in a statement IDE (Integrated Development Environment)IDE (Integrated Development Environment) –JavaEyes, Part 4: Documenting your program’s code - Javadoc Summarized on the next few slides

2 Fundamentals of Software Development 1Slide 2 Objects and Names There are two types of things in Java: – –Objects the button that the user just pressed the URL of your home page – –Primitive-type things The integer that represents the number of times you have visited Alaska The character that represents your middle initial There are 8 primitive types, all of which begin with a lower-case letter: – –The most commonly used are int, double, char and boolean – –Less common are long, short, byte and float We use names (also called variables) to refer to objects buttonUserPressed homeURL mobyDick and to primitive-type things: numberOfTimesVisitedAlaska middleInitial

3 Fundamentals of Software Development 1Slide 3 What can you do with names? 1. 1.Declare the type of the name JButton buttonUserPressed; char middleInitial; 2. 2.Give (assign) a value to the thing to which the name refers buttonUserPressed = new JButton(“press me”); yourMiddleInitial = ‘C’; 3. 3.Refer to the thing to which the name refers, in an expression buttonUserPressed.isEnabled() numberOfTimesVisitedAlaska < 5 System.out.println(yourMiddleInitial) These dot notation references are where the power of an OOP language lies! Java is a strongly typed language – every name must have a type. The type of an object helps the compiler: (and programmer) tell what kinds of thing the object can do write more efficient code The type name pattern appears often in Java

4 Fundamentals of Software Development 1Slide 4 Documenting your program’s code A comment is an area in your program that is deliberately ignored by the compilerA comment is an area in your program that is deliberately ignored by the compiler –Programmers put comments in their program's code to help themselves and others Understand their codeUnderstand their code Use their codeUse their code Doc-comments have a special format that lets them be translated to a standard form of HTML. They:Doc-comments have a special format that lets them be translated to a standard form of HTML. They: –Are used to comment every public class, field, constructor and method –Begin with /** and end with */ –Have words describing the item –Have the following tags as appropriate: @author @param @return

5 Fundamentals of Software Development 1Slide 5 What’s Ahead? Before the next session:Before the next session: –Do Homework 4 (no late homework!) Including the reading and the associated online quizIncluding the reading and the associated online quiz Make arrangements NOW to meet with your partner to complete JavaEyes, Part 4!Make arrangements NOW to meet with your partner to complete JavaEyes, Part 4! –Next session: InterfacesInterfaces UML: Reverse-engineering JavaEyesUML: Reverse-engineering JavaEyes Reminder: Find the homework assignment from the Schedule page of the CSSE 120 Angel site angel.rose-hulman.edu Suggestion: Routinely do your homework in F-217 (CSSE lab). A student assistant is there every Sunday through Thursday evening, 7 pm to 9 pm, so you can get immediate answers to any questions you might have.


Download ppt "Fundamentals of Software Development 1Slide 1 Today’s Summary Things, types and names – –What are names? types? – –Why use names? – –How to use a name:"

Similar presentations


Ads by Google