Advanced Programming in Java Sadegh Aliakbary Sharif University of Technology Fall 2010
Feb 14, 2016
Advanced Programming in Java
Sadegh AliakbarySharif University of Technology
Fall 2010
Sharif University of Technology 2
AgendaIntroduction to CourseJava HistoryJava CharacteristicsFirst ExampleSyllabusEvaluation Policy
Fall 2010
Sharif University of Technology 3
This Course Covers:Java programming languageObject Oriented ConceptsSome Programming Skills
TestRefactoringCode Smell
Fall 2010
Sharif University of Technology 4
Java HistoryJava was created in 1991by James Gosling in Sun Microsystems.Initially called Oak
in honor of the tree outside Gosling's windowIts name was changed to Java
because there was already a language called Oak.
Sun Microsystems released the first public implementation as Java 1.0 in 1995
Java syntax is similar to C and C++.Fall 2010
Sharif University of Technology 5
Java MotivationThe need for platform independent
languageTo be embedded in various consumer
electronic products like toasters and refrigerators
Platform independent?!HardwareOperating System
Fall 2010
Sharif University of Technology 6
Java Motivation (2)At the same time, the World Wide Web and
the Internet were gaining popularity. Java could be used for Internet programming.Why?
Platform independenceCreation of AppletsNow, Java is used mostly for server-side
programming
Fall 2010
Sharif University of Technology 7
The Java technology is:A programming language
Java can create all kinds of applicationsA development environment
A compiler (javac)An interpreter (java)A documentation generator (javadoc)…
Compare it to C++
Fall 2010
Sharif University of Technology 8
High-Level Languages
Fall 2010
Sharif University of Technology 9
Java Virtual Machine
Fall 2010
Sharif University of Technology 10
Compile and Execution StagesCompare
to C++ and Assembly
.NET Framework
Fall 2010
Sharif University of Technology 11
First ExampleCreate a file named First.java
Java class files have .java extensionNote to naming convention
Copy this lines to the fileNote: File name and class name should be the
same.
Fall 2010
Sharif University of Technology 12
First Example (2)Run javac First.javaRun java First
We don’t use any IDE now.To highlight compile and run stages.
Lets watch it in real world!
Fall 2010
Sharif University of Technology 13
Overview of the Example
Fall 2010
Sharif University of Technology 14
Java is PopularSome reports on programming languages
popularityAccording to
Job advertisementsBook salesFinding code on the web…
Fall 2010
Sharif University of Technology 15Fall 2010
http://www.langpop.comupdated in 2010
Sharif University of Technology 16Fall 2010
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
Sharif University of Technology 17
Characteristics of JavaJava is simpleJava is object-orientedJava is architecture-neutralJava is portableJava is interpretedJava is multithreadedJava is secureJava is robust
Fall 2010
Sharif University of Technology 18
ConclusionJava is a
Simpleobject orientedRobustAnd popular
Java is platform independent.Write Once, Run Anywhere!
Fall 2010
Sharif University of Technology 19
Further ReadingRead Java page on Wikipedia
http://en.wikipedia.org/wiki/Java_(programming_language)Google this terms and phrases:
Fall 2010
JavaJava MobileJVMByte codeJava Sun
Java and C++Java and C#
Sharif University of Technology 20
ExercisesDownload and install JDKWrite a program that prints your name on the
consoleCompile and run the program
Fall 2010
Sharif University of Technology 21
Evaluation PolicyFinal Exam: 4Midterm Exam 1: 2Midterm Exam 2: 2Quiz & Attendance : 4Assignments: 3Projects: 6+
(Sum=21)
If you don’t want to attend this class…
Fall 2010
Sharif University of Technology 22
TopicsIntroduction to java
languageJava syntax, operators,
conditions, loops, …StringsArrays
Object Oriented Programming
InheritancePolymorphismCollectionsGenerics
Exception Handling
Files and I/OThreadsReflectionTestRefactoringGUINetworking
Fall 2010
Sharif University of Technology 23Fall 2010