You are on page 1of 3

The Java™ Programming Language is a

general-purpose, concurrent, strongly


An Introduction typed, class-based object-oriented
to JAVA JAVA
language. It is normally compiled to the
bytecode instruction set and binary
Programming Programming format defined in the Java Virtual
Language Machine Specification.
Language (https://docs.oracle.com/javase/8/docs/te
Lesson 1 chnotes/guides/language/index.html)

The Way Java Works…

The java source code files (files


with .java extension) are
JAVA compiled into a format called
Programming bytecode (files with .class
Language extension), which can then be
executed by a Java interpreter.

Initially, C++ language was used as the


brains for smart appliances. Gosling was
Originally called the Oak. unhappy with the results he was getting
Developed by Sun Microsystems’ using C++ so he developed his own
engineer James Gosling. language.
A Brief A Brief The language he created was small in
It was intended for use in Sun’s project
History research to work on a programming
History size, efficient, reliable and very portable.
software to control consumer electronic Java language was officially launched in
1995.
devices.
WebRunner (later named as HotJava)
was the very first web created using Java.
Java Program Parts

Open the application Eclipse.


Create a new class with the Class name:
Activity 1 SampleExercise1
Type the following codes:

public class SampleExercise1


Comments are ignored by the {
compiler but are useful to other
programmers. }

The comments can be used to The Class  SampleExercise1 is the name of the Java class. Note
Comment that the file must be named to class name with .java
provide information or explanation definition extension.
about the variable, method, class or  The second line of the program consists of the left
any statement. It can also be used to brace, which is matched with the second right brace
(the very last brace). These braces together mark the
hide program code for specific time. beginning and end of (the body of) the class
SampleExercise1.
In Java, every application must contain a
main method whose signature is: System.out.println(“Welcome”);
public static void main(String[] args)
The main
Method Java program processing starts from
the main() method which is a It prints the characters between
mandatory part of every Java quotes to the console.
program.
The JVM starts running any program by
executing this method first.

 Keep in mind the following points: Method Names − All method names
 Case Sensitivity − Java is case sensitive, which means should start with a Lower Case letter. If
identifier Hello and hello would have different several words are used to form the
meaning in Java. name of the method, then each inner
 Class Names − For all class names the first letter word's first letter should be in Upper
Basic should be in Upper Case. If several words are used to Basic Case.
form a name of the class, each inner word's first letter
Syntax should be in Upper Case. Syntax Example: public void myMethodName()
 Class names always start with an uppercase letter and Program File Name − Name of the
follow PascalCase program file should exactly match the
 Example: class MyFirstJavaClass class name.

You might also like