Comparing Java to Drawing a Picture •Humans use Java, a programming language, to give instructions to the computer to perform a specific task or solve a problem.•We create JAVA source files (humans can read and edit these files).•The person giving the INSTRUCTIONSis the “source code”.•We COMPILE (translate) our Java source files into a CLASS file so that the computer can understand it.•The person DRAWING the image is the “compiler”.
Keywords Java Understands•public•class•SystemIdentifiers: words programmers creates•ClassName•SecondClass
What is a Class?•A Class is used to define a type (classify something).•String, Math, System, List, ArrayList•Classes create Objects.•Objects do the actual work in object-oriented programming.•For example: Class Cats.•This class can create many different kinds of Cat Objects.
First Example: Classes•To define a class use the keywords that Java understands: followed by a ClassName.