290 likes | 303 Vues
Learn the basics of Java programming, including problem-solving skills, high-level and low-level languages, Java history, and the motivation behind its creation. Explore Java's characteristics, popularity, and different editions, and get started with hands-on examples.
E N D
Introduction AdvancedProgramming in Java MehdiEinali
Agenda • Introduction to Programming • Java History • Introduction to Java
Think as Computer Scientist • Problem-Solvingthe ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately • The process of learning to program is an excellent opportunity to practiceproblem-solving skills.
Programming languages • High level language • Java, Python, C or C++, and Perl • Low level languages • machine language or assembly language • Loosely-speaking, computers can only run programs written in low-level languages • Translate from high level to low-level = compile or interpret
advantages High level languages • It is much easier to program in a high-level language • less time, shorter and easier to read , most likely to be correct • Portable • can run on different kinds of computers withfew or no modifications
Java history • Java was created in 1991 by James Gosling in Sun Microsystems • Initially called Oak • in honor of the tree outside Gosling's window • Its 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++.
Java Motivation • The need for platform independent language • To be embedded in various consumer electronic products • like toasters and refrigerators • Currently Phone, Wear, Auto, TV (just with android) • Platform independent?! • Hardware • Operating System
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 independence • Creation of Applets • Open Source Culture • JCP, JSR
The Java technology is: • A programming language • Java can create all kinds of applications • A development environment • A compiler (javac) • An interpreter (java) • A documentation generator (javadoc) • A built in library (Java API) • … • Compare it to C++
Compile and Execution Stages • Compare to C++ and Assembly • .NET Framework
Java is Popular • Some reports on programming languages popularity • According to • Job advertisements • Book sales • Finding code on the web • …
Characteristics of Java • Java is simple • Java is object-oriented • Java is architecture-neutral • Java is portable • Java is interpreted • Java is multithreaded • Java is secure • Java is robust
Oracle, Sun, … Scott McNealy, former Sun Microsystems CEO, and Larry Ellison of Oracle announce a closer partnershipin 2006, which led to Oracle acquiring Sun in 2009.
Java editions • Old literature • Java Standard Edition(Java SE) • Currently version 8 • Java Enterprise Edition (Java EE) • Currently version 7 • Java Mobile Edition
Java Se • Java language and libraries • JRE and JDK • Java programs: • Java application • Java Applet • Replaced with JavaFX
Java EE • Java Platform, Enterprise Edition (Java EE) is the standard in community-driven enterprise software • Web technologies • Servlet, JSF • Data access • Community based(JCP) • API Based • Agree on API compete on implementation
Java ME • provides a robust, flexible environment for applications running on embedded and mobile devices in the Internet of Things: micro-controllers, sensors, gateways, mobile phones, personal digital assistants (PDAs), TV set-top boxes, printers and more • Currently replaced with Android
First Example • Create a file named First.java • Java class files have .java extension • Note to naming convention • Copy this lines to the file • Note: File name and class name should be the same.
Assignment # 0 • Download and install JDK • http://www.oracle.com/technetwork/java/javase/downloads/index.html • JDK 8 • Jet brain's really Intelligent IntelliJ IDEA™ Community Edition • https://www.jetbrains.com/idea/download/ • Write a program that prints your name on the console • Compile and run the program
Topics • Introduction to java language • Java syntax, operators, conditions, loops, … • Strings • Arrays • Advanced Java Programming • Exception Handling • Generics • Collections • Threads • Files and Streams • Networking • Reflection • Functional Programming • GUI(a little) • Object Oriented Programming • Interface • Inheritance • Polymorphism • Software Quality • Refactoring • Test • An introduction to programming world • Think like Programmers