Welcome to Java Beginner Lessons Lesson 1.
First we will define what Java is. JAVA is a programming language that you can write programs with to run on computers.
We begin learning how to write programs in Java by writing a program, like this one:
class JavaOne
{
}
{
}
This is a complete Java program because it does not create a compiler error. What is a compiler error? COMPILER ERROR is what happens when you try to compile your program and the compiler gives you back your errors. Why do you have to compile your program? Compiling your program is the first step to turning your program into a code that can be read by the computer. The computer has its own language and it does not understand English or any spoken language. Therefore, you need a compiler to translate your program into a code executable by a computer.
Let us look now in detail into the workings of our first program, word for word, and symbol by symbol.
class is a Java keyword. JAVA KEYWORDS are the words that Java understands. For example, if someone says "person", you immediately refer that word to a human being. The same translation of a keyword happens in Java, except to Java, "person" is not a keyword.
JavaOne is a word that a person who wrote the program just made up.
{ and } are OPEN BRACE and CLOSED BRACE and both symbols are JAVA SYMBOLS OR WORDS that Java understands.
Pop Quiz.
What is Java?
Why do you have to compile your program?
What are Java keywords?
No comments:
Post a Comment