A computer is an electronic device that stores and processes data. A computer includes both hardware and software . In general, hardware is the physical aspect of the computer that can be seen, and software is the invisible instructions that control the hardware and make it perform tasks .
Computer programs , known as software , are instructions to the computer. You tell a computer what to do through programs. Computer programming consists of writing instructions for computers to perform.
The machine language is a set of primitive instructions built into every computer. Assembly language is a low-level programming language in which a mnemonic is used to represent each of the machine-language instructions.
High-level languages are English-like and easy to learn and program. There are over one hundred high-level languages. A program written in a high-level language is called a s ource program . Since a computer cannot understand a source program, a program called a compiler is used to translate the source program into a machine language program, which is then linked with other supporting library code to form an executable file.
The operating system (OS) is a program that manages and controls a computer's activities. Application programs, such as Web browsers and word processors, cannot run without an operating system.
Java was developed by a team led by James Gosling at Sun Microsystems. It is an Internet programming language. Since its inception in 1995, it has quickly become a premier language for building software.
Java is platform-independent, meaning that you can write a program once and run it anywhere .
Java programs can be embedded in HTML pages and downloaded by Web browsers to bring live animation and interaction to Web clients .
Java source files end with the .java extension. Every class is compiled into a separate file bytecode that has the same name as the class and ends with the .class extension.
To compile a Java source code file, use the javac command. To run a Java class, use the java command.
Every Java program is a set of class definitions. The keyword class introduces a class definition. The contents of the class are included in a block. A block begins with an opening brace and ends with a closing brace Methods are contained in a class.
A Java application must have a main method. The main method is the entry point where the application program starts when it is executed.