Professional Documents
Culture Documents
Lecture 1
1
Lecturer: Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
2
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
3
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
1.5.1 Netbeans
NetBeans is an open-source, free Java IDE with a modular
architecture. It has a multi-language editor, debugger, profiler,
versioning control, and developer collaboration. It supports the
development of other languages like PHP and C++. It integrates
all the functionality of Java. NetBeans runs on all major operating
systems like Windows, Linux, and Mac OS. It is an easy to install
IDE and provides skeleton applications and templates with sample
applications as well and let developers save time by letting them
start coding on a skeleton project. so that they don’t have to go
5
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
6
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
1.5.1 Eclipse
Eclipse is an open-source and free IDE with a modular
architecture. It is the most popular Java IDE. It provides support
for the development of many languages but it is mostly focused on
Java and C/C++ development. Eclipse is compatible to run on all
types of operating systems like Windows, Linux, and Mac OS.
Eclipse also provides the support for working on documentation
and modeling using papyrus and provides tools for
implementation of UML, SysML, OCL etc.
8
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
1.5.3 Intellij
IntelliJ IDEA which is a part of JetBrains is available in both free
source and a commercial edition. Already, it has the Resharper
plugin for Visual Studio in C# development by JetBrains. IntelliJ
supports a variety of languages such as Clojure, Groovy, Scala,
Java and many more; it also has features such as advanced
forecasting, code analysis, and smart code completion. It supports
PHP, Ruby, Python, SQL, and ActionScript. Recently, it has
launched version 12 which comes with the new Android UI for
Android app development. It allows users to submit more plugins
9
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
11
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
text. Below the program followed by a box that displays its output.
File name is (Welcome1.Java)
12
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
-Class Body
13
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
The first left brace {, begins the body of every class declaration. A
corresponding right brace , }, must end each class declaration.
- The parentheses after the identifier main indicate that it’s a
program building block called a method. Java class declarations
normally contain one or more methods. For a Java application, one
of the methods must be called main; otherwise, the Java Virtual
Machine (JVM) will not execute the application. Methods perform
tasks and can return information when they complete their tasks.
-System.out
The system.out object—which is predefined for you—is known as
the standard output object. It allows a Java application to
display information in the command window from which it
executes.
-System.out.print
-System.out.println
Method System.out.println displays (or prints) a line of text in
the command window. The string in the parentheses is the
argument to the method.
14
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
The next statement calls the println method of the system class
and prints the sentence "welcome to java programming". As with
other methods, the arguments to pass to the method are declared
between open and close parentheses. Each statement in Java ends
in semicolon:
System.out.println("welcome to java programming ");
The final two lines of welcome1 program are close brackets. The
first close bracket completes the block of code associated with the
main() method. The second close brackets completes the block of
code associated with welcome class.
Exmple2:
16
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
Example3:
public class Main {
public static void main(String[] args) {
System.out.println("Welcome");
System.out.println("to");
System.out.println("information");
System.out.print(" engineering");
} // end method main
} // end class Main
Output:
Welcome
to
information
engineering
17
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry
College of Information Engineering
Department of Computer f Networks Engineering &
OOPII(Java), 2nd Class
18
Asst. Prof. Dr. Lahieb Mohammed Al-Yassiry