You are on page 1of 5

CST1201 Programing Fundamentals

Lecture I: Introduction to Java Programming Language


Programming Language: A programming language is designed to communicate instructions to a
machine, particularly a computer. Programming languages can be used to create programs
(software) to control the behavior of a machine or to express algorithms.
Two classification of software:

Operating systems: Window 8, Unix, Linux, MacOS, etc.


Applications: MS word, Excel, games, etc.

Three classifications of programming languages:

Machine language: only language understood by computer with instruction


represented by binary codes. It is difficult for human to create application using

machine language.
Assembly language: processor dependent, instructions are easier to create. Assembler
can translate the program to machine codes.
High level languages: processor independent
o Compiler: translates a complete program into object code and then create an
executable file. E.g. C++, Visual Basic.
o Interpreter: translate one instruction at a time at the program execution. For
example, JavaScript, Python, PHP.

Java Programming language: first released in 1995 by Sun Microsystem ( now Oracle); run on
various operating systems; 1998- Java 2; 2006 Java SE 6 2011 Java SE 7 2014 Java SE 8
HelloWorld.java
public class HelloWorld
{
public static void main(String[] args)
{
String message = "Hello World";
System.out.println(message);
}
}
Syntax: the set of rules that defines how declarations, functions, commands, and other
statements should be arranged. Spelling and Grammar rule of a programming language

CST1201 Programing Fundamentals

Statement: Instruction represented in programming language


Source code: Statements written in programming language, with file extension .java
Text editor: used to edit and save source code as .java file
Syntax errors: mistakes that the programmer has made that violate the rules of the programming
language
NetBeans IDE: NetBeans IDE lets you quickly and easily develop Java desktop, mobile, and
web applications, as well as HTML5 applications with HTML, JavaScript, and CSS. The IDE
also provides a great set of tools for PHP and C/C++ developers. It is free and open source and
has a large community of users and developers around the world.
To download and install on your own computer:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download432126.html
How to use Netbeans
1. Open Netbeans IDE: Start-> Program -> Netbeans
2. Create new project: File -> New project, select Java and Java
Application then click next

3. Give a name to your project, browse to a folder where you want your
project to be created and leave create main class and set as main

CST1201 Programing Fundamentals

project options checked. Then click Finish.

4. You should see an open file with Main.java to start typing in your code

5. To run your program, click on the green triangle button.


6. To add another program file: click menu File New File ->Java-> Java
class, click Next, then give a file name and click Finish.
7. To run one of multiple java file in one project: right click at the file
name and select Run File

CST1201 Programing Fundamentals

Practice
Fill in the Blank in the following questions:
1. Who first created Java Programming language?_______________
2. What type of application Java programming language can create: Stand Alone, _____,
3.
4.
5.
6.

_______.
What is the IDE stand for: _________________________________________________.
Other IDE for Java Programming: ______________________________________.
Name two programming language that use complier:_____________, _______________.
Name three programming language that use interpreter: _________, ___________,

_________.
7. Does Java programming language use compiler, interpreter, or both?
8. How to add comment document into program code?

Programming exercise:
Create the first program that prints out:
Welcome to summer CST1201 Java Programming class

CST1201 Programing Fundamentals

You might also like