System - Out.println ("Hello, World!") : Object
System - Out.println ("Hello, World!") : Object
String = it is just a technical term for the text (that could be words or numbers or
mathematical expressions. A text is usually enclosed in quotation marks
Object(s) = they are things that do work for us in a program. In the exercises I have been
doing, the objects represent the Terminal Window in which a String or number is printed
when printlng does his job.
Method = it is an instruction that is being executed.
System.out.println(Hello, World!);
Object
Method
String
TYPE OF ERRORS
1. Compile-time error (syntax error) = it is called Compile-time error because it is
found when you compile.
System.ouch.println(Hello, World!);
The terminal window object is System.out. not System.ouch.
When we try to Compile, the compiler (the program that translates Java into a
lower level code complains and it says I have no idea what the Variable ouch is.
Cannot find symbol variable ouch
The compiler knows System.out. but it does not know System.ouch.
System.out.println(Hello, Sarah);
The above error is an example of a compile-time error because the computer
doesnt know what we mean by HELLO. What we wanted is for Hello, Sarah to be
literal texts. In order to do that, we need to quotation marks (Hello, Sarah)
total cost 2
Buy car 1
Else
Buy car 2