Download presentation
Presentation is loading. Please wait.
Published byRaymond Stewart Modified over 9 years ago
1
Catie Welsh January 31, 2011 1
2
Project 1 Due Wednesday Lab 1 Grades are posted 2
3
3
4
4 Errors Strings Review
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
6
UNCisGreat 01234567891011 String output = myString.substring(1, 8); 6
7
System.out.println(“How do I put \“quotes\” in my string?”); \”Double quote \’Single quote \\Backslash \nNew line \rCarriage return \tTab 7
8
System.out.print(“this is a string”); System.out.println(“this is a string”); What is the difference? 8
9
See p. 90
10
Meaningful names Indenting Documentation Defined Constants 10
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
12
Hardware - physical machine ◦ CPU, Memory Software - programs that give instructions to the computer ◦ Windows XP, Games, Eclipse 12
13
Object-Oriented Programming Language ◦ Objects and methods
14
“Information hiding” Putting things in a capsule Methods in the String class ◦ myString.length();
15
“many forms” Same instruction to mean same thing in different contexts. ◦ Example: “Go play your favorite sport.” I’d go play lacrosse. Others of you would play baseball instead. In programming, this means that the same method name can cause different actions depending on what object it is applied to. 15
16
Organizing classes so properties only have to be defined once
17
Read 3.1 Project 1 Due Project 2 Assigned 17
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.