SlideShare uma empresa Scribd logo
1 de 12
JAVA
PROGRAMMING


By
Muhammad
Khalid
Web Developer
COURSE OUTLINE
   Introduction
   Data types & Variable
   Operators
   Flow control (Loops)
   Decisions
   Arrays and Strings
   Classes and objects(Object Oriented Concept)
   Inheritance
   Packages and Access Modifiers
   Polymorphism
   Interfaces
   AWT and Applets
   IO
   Threads
   Servlets
GENERATIONS
 FirstGeneration
   Machine Language
 Second Generation

   Assembly Language
 Third Generation

   C, Basic, FORTRAN etc
 Fourth Generation

   C++,JAVA etc
HISTORY OF JAVA
 The Green Project
   1991
   Developed by small group of Sun engineers
    (Green Team)
   Purpose: Intelligent consumer electronic
    market
 The name JAVA

 Launched in 1995
INTRODUCTION
 It’s
     a general purpose programming language
 Java was based on C, C++ Language

 Java   is case sensitive
STRENGTHS OF JAVA
 Simple

 Pure Object Oriented
 Platform Independent

 Secure

 Distributed (RMI)

 Multi Threaded (Synchronization)

 No Memory Constraints (Garbage collection)
ARCHITECTURE
  Java Source File       Java Compiler




 Java Virtual Machine   Java Object Code
   Java Interpreter


  Operating System
ARCHITECTURE
JAVA VIRTUAL MACHINE
PROGRAM DEVELOPMENT
   Install the JDK along with its documentation
       http://www.oracle.com/technetwork/java/javase/downloads/i
        ndex.html
   Command Line
     Edit the source code
        Use any editor, windows notepad is a good choice
        

       Source code have extension .java

     Compile the Source code
           Use javac
       Run the program
           Use java
   Integrated Development Environment (IDE)
       KAWA, Eclipse, jCreator, SpringSource, etc
FIRST JAVA PROGRAM
// My first program in java
   public class MyJava
   {
       public static void main ( String args [ ] )
       {
       /* I am inside main . Execution always starts
   from method main in java applications*/
               System.out.println ( “Hello JAVA” )
   ;
       }
   }
FIRST JAVA PROGRAM
 Write javac followed by the name of the source
  code file(.java)
    javac MyJava.java

 A file named MyJava.class would be created (byte
  code.)
 Write java MyJava (without any extension) to
  run the class.

Mais conteúdo relacionado

Mais procurados (6)

Oop lecture2
Oop lecture2Oop lecture2
Oop lecture2
 
Programming
ProgrammingProgramming
Programming
 
Log4j Logging Mechanism
Log4j Logging MechanismLog4j Logging Mechanism
Log4j Logging Mechanism
 
Network Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkNetwork Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot Framework
 
1.3 tools and-repl
1.3 tools and-repl1.3 tools and-repl
1.3 tools and-repl
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 

Semelhante a 1 introduction

Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
sotlsoc
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
Manuel Fomitescu
 

Semelhante a 1 introduction (20)

Corejava
Corejava Corejava
Corejava
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with java
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to java
 
Dr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to javaDr. Rajeshree Khande :Intoduction to java
Dr. Rajeshree Khande :Intoduction to java
 
javacourse in c.pdf
javacourse in c.pdfjavacourse in c.pdf
javacourse in c.pdf
 
javacourse in c.pdf
javacourse in c.pdfjavacourse in c.pdf
javacourse in c.pdf
 
java basics.pptx
java basics.pptxjava basics.pptx
java basics.pptx
 
Java - At a glance
Java - At a glanceJava - At a glance
Java - At a glance
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Java platform
Java platformJava platform
Java platform
 
Java Lecture 1
Java Lecture 1Java Lecture 1
Java Lecture 1
 
Object Oriented Programming-JAVA
Object Oriented Programming-JAVAObject Oriented Programming-JAVA
Object Oriented Programming-JAVA
 
Programming in Java
Programming in JavaProgramming in Java
Programming in Java
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
OOPS JAVA.pdf
OOPS JAVA.pdfOOPS JAVA.pdf
OOPS JAVA.pdf
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
 
core java
core javacore java
core java
 

1 introduction

  • 2. COURSE OUTLINE  Introduction  Data types & Variable  Operators  Flow control (Loops)  Decisions  Arrays and Strings  Classes and objects(Object Oriented Concept)  Inheritance  Packages and Access Modifiers  Polymorphism  Interfaces  AWT and Applets  IO  Threads  Servlets
  • 3. GENERATIONS  FirstGeneration  Machine Language  Second Generation  Assembly Language  Third Generation  C, Basic, FORTRAN etc  Fourth Generation  C++,JAVA etc
  • 4. HISTORY OF JAVA  The Green Project  1991  Developed by small group of Sun engineers (Green Team)  Purpose: Intelligent consumer electronic market  The name JAVA  Launched in 1995
  • 5. INTRODUCTION  It’s a general purpose programming language  Java was based on C, C++ Language  Java is case sensitive
  • 6. STRENGTHS OF JAVA  Simple  Pure Object Oriented  Platform Independent  Secure  Distributed (RMI)  Multi Threaded (Synchronization)  No Memory Constraints (Garbage collection)
  • 7. ARCHITECTURE Java Source File Java Compiler Java Virtual Machine Java Object Code Java Interpreter Operating System
  • 10. PROGRAM DEVELOPMENT  Install the JDK along with its documentation  http://www.oracle.com/technetwork/java/javase/downloads/i ndex.html  Command Line  Edit the source code Use any editor, windows notepad is a good choice   Source code have extension .java  Compile the Source code  Use javac  Run the program  Use java  Integrated Development Environment (IDE)  KAWA, Eclipse, jCreator, SpringSource, etc
  • 11. FIRST JAVA PROGRAM // My first program in java public class MyJava { public static void main ( String args [ ] ) { /* I am inside main . Execution always starts from method main in java applications*/ System.out.println ( “Hello JAVA” ) ; } }
  • 12. FIRST JAVA PROGRAM  Write javac followed by the name of the source code file(.java) javac MyJava.java  A file named MyJava.class would be created (byte code.)  Write java MyJava (without any extension) to run the class.

Notas do Editor

  1. Machine languages are the only languages understood by computersAn assembly language is a low-level programming language for a computer, microcontroller, or other programmable device, in which each statement corresponds to a single machine code instruction. Each assembly language is specific to a particular computer architecture
  2. One challenge presented to software developers by the increasingly network- centric hardware environment is the wide range of devices that networks interconnect. A typical network usually has many different kinds of attached devices, with diverse hardware architectures, operating systems, and purposes. Java addresses this challenge by enabling the creation of platform-independent programs. A single Java program can run unchanged on a wide range of computers and devices. Compared with programs compiled for a specific hardware and operating system, platform-independent programs written in Java can be easier and cheaper to develop, administer, and maintain. Another challenge the network presents to software developers is security. In addition to their potential for good, networks represent an avenue for malicious programmers to steal or destroy information, steal computing resources, or simply be a nuisance. Virus writers, for example, can place their wares on the network for unsuspecting users to download. Java addresses the security challenge by providing an environment in which programs downloaded across a network can be run with customizable degrees of security. One aspect of security is simple program robustness. Like devious code written by malicious programmers, buggy code written by well-meaning programmers can potentially destroy information, monopolize compute cycles, or cause systems to crash. Java's architecture guarantees a certain level of program robustness by preventing certain types of pernicious bugs, such as memory corruption, from ever occurring in Java programs. This establishes trust that downloaded code will not inadvertently (or intentionally) crash, but it also has an important benefit unrelated to networks: it makes programmers more productive. Because Java prevents many types of bugs from ever occurring, Java programmers need not spend time trying to find and fix them. One opportunity created by an omnipresent network is online software distribution. Java takes advantage of this opportunity by enabling the transmission of binary code in small pieces across networks. This capability can make Java programs easier and cheaper to deliver than programs that are not network- mobile. It can also simplify version control. Because the most recent version of a Java program can be delivered on-demand across a network, you needn't worry about what version your end-users are running. They will always get the most recent version each time they use your program. Mobile code gives rise to another opportunity: mobile objects, the transmission of both code and state across the network. Java realizes the promise of object mobility in its APIs for object serialization and RMI (Remote Method Invocation). Built on top of Java's underlying architecture, object serialization and RMI provide an infrastructure that enables the various components of distributed systems to share objects. The network-mobility of objects makes possible new models for distributed systems programming, effectively bringing the benefits of object-oriented programming to the network. Platform independence, security, and network-mobility--these three facets of Java's architecture work together to make Java suitable for the emerging networked computing environment. Because Java programs are platform independent, network-mobility of code and objects is more practical. The same code can be sent to all the computers and devices the network interconnects. Objects can be exchanged between various components of a distributed system, which can be running on different kinds of hardware. Java's built-in security framework also helps make network-mobility of software more practical. By reducing risk, the security framework helps to build trust in a new paradigm of network-mobile software.
  3. The Java virtual machine (JVM) is a software implementation of a computer that executes programs like a real machine. The Java virtual machine is written specifically for a specific operating system, e.g. for Linux a special implementation is required as well as for Windows. Java programs are compiled by the Java compiler into so-called bytecode. The Java virtual machine interprets this bytecode and executes the Java program.