Class Notes (806,817)
Canada (492,453)
CSC207H1 (40)


2 Pages
Unlock Document

University of Toronto St. George
Computer Science
Diane Horton

SEPTEMBER 12  Netbeans, choose Jaa Java application o codes haveto be inside projects  No functions in Java, only methods –ex. python Print Hello in Java o Usually 1 file per class, file name same as class name w/ case sensitive o everything inside class = everything object oriented  Function doesn’t belong to anything, methods belong to class and apply to an object o args the command line arguments, indicated end of parameters  Compile = take entire software, pullsit apart, identify all parts,translate to machine language o Produce one executable file o Translated for one machine, not transferable to another machine o to compile in command line: javac [filename].java  creates a [file].class that is translated [file].java o to run in command line: java [filename]  don’t need to add .class  Printing "the standard output" o the screen, unless you do something special to redirect it) o Strings in Java have to be double quotes 1. class Hello { 2. public static void main(String[] args) { 3. System.out.println("Hello world, this is the most boring program ever!"); 4. } 5. } o Public = called anywhere; Private = only callable inside the class; Statics = only 1 main  Comments: three kinds o 1. Single-line comment; like # in python o 2. Standard internal comment not intended for external viewing  be several lines long o 3. Multi-line Javadoc comment. Documentation is automatically generated from these  netbeans will snug the javadoc to the next line no matter what the line is 1. // Type 1 = Single line comments 2. 3. /* 4. * Type 2 = Standard internal comment 5. * 6. */ 7. 8. /** 9. * Type 3 = Multi-line Javadoc comment 10. * 11. */  Types: every variable has a type, types fall into two categories o 1. Primitive types  primitive values are NOT objects  the value (not a reference to it) sits directly in the box  byte, short, int, long, float, double, boolean, char  primitive type names begin w/ lowercase letters  single quotations for char 1. int age = 5; 2. Boolean love
More Less

Related notes for CSC207H1

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.