SLIDE 1
Darrell Bethea May 16, 2011 1 Program 1 Due Wednesday 2 3 - - PowerPoint PPT Presentation
Darrell Bethea May 16, 2011 1 Program 1 Due Wednesday 2 3 - - PowerPoint PPT Presentation
Darrell Bethea May 16, 2011 1 Program 1 Due Wednesday 2 3 Errors Strings Review 4 Syntax error - grammatical mistake in your program Run-time error - error that is detected when your program is run Logic error -
SLIDE 2
SLIDE 3
3
SLIDE 4
4
Errors Strings Review
SLIDE 5
Syntax error - grammatical mistake in your
program
Run-time error - error that is detected when
your program is run
Logic error - the output of your program is
incorrect
SLIDE 6
U N C i s G r e a t 1 2 3 4 5 6 7 8 9 10 11 String output = myString.substring(1, 8);
6
SLIDE 7
System.out.println(“How do I put \“quotes\”
in my string?”);
\” Double quote \ʼ Single quote \\ Backslash \n New line \r Carriage return \t Tab
7
SLIDE 8
System.out.print(“this is a string”); System.out.println(“this is a string”); What is the difgerence?
8
SLIDE 9
See p. 90
SLIDE 10
Meaningful names Indenting Documentation Defined Constants
10
SLIDE 11
public static final Type Variable = Constant; Named in ALL_CAPS public class DefinedConstant
{ public static final double PI = 3.14159; public static void main(String[] args)
{
11
SLIDE 12
Hardware - physical machine
- CPU, Memory
Software - programs that give instructions to
the computer
- Windows XP, Google Chrome, Games, Eclipse
12
SLIDE 13
Object-Oriented Programming Language
- Classes
- Objects
- Methods
SLIDE 14
“Information hiding” Users of a class only need to know methods Methods in the String class
- myString.length();
SLIDE 15
“many forms” Same instruction to mean same thing in
difgerent contexts.
In programming, this means that the same method
name can cause different actions depending on what
- bject it is applied to.
- rectangle.area();
- circle.area();
15
SLIDE 16
Organizing classes so properties only have to
be defined once
SLIDE 17