introduction to java programming
Download
Skip this Video
Download Presentation
Introduction to Java Programming

Loading in 2 Seconds...

play fullscreen
1 / 18

Introduction to Java Programming - PowerPoint PPT Presentation


  • 144 Views
  • Uploaded on

Introduction to Java Programming. Introduction. Java vs C++ Java Syntax Java API How to build stand-alone applications Examples. Java vs C++. Similar Syntax Run anywhere (Java), Compile anywhere (C++) No native support for unsigned arithmetic in Java

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Introduction to Java Programming' - sally


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
introduction
Introduction
  • Java vs C++
  • Java Syntax
  • Java API
  • How to build stand-alone applications
  • Examples
java vs c
Java vs C++
  • Similar Syntax
  • Run anywhere (Java), Compile anywhere (C++)
  • No native support for unsigned arithmetic in Java
  • Automatic memory garbage collection in Java
  • Java runs in a virtual machine, C++ runs as native executable machine code
java syntax
Java Syntax
  • The set of legal structures and commands that can be used in a particular programming language
java syntax1
Java Syntax

class Foo {// Defines class Foo

privateint x;// Member variable, normally variables

// are declared as private to

// enforce encapsulation

//initialized to 0 by default

publicFoo(){

// Constructor for Foo

}

publicint bar(inti){

// Member method bar()

return3*i+ x;

}

}

java syntax2
Java Syntax

Foo a;// declares a to be a reference to a Foo object

a =new Foo();// initializes using the default constructor

// Another constructor can be used as

Foo a =new Foo(args);

java api
Java API

There are 3 types of Java Programming Language Application Programming Interfaces (APIs)

  • the official core Java API, contained in the JDK or JRE, of one of the editions of the Java Platform. The three editions of the Java Platform are Java ME (Micro edition), Java SE (Standard edition), and Java EE (Enterprise edition).
  • optional official APIs that can be downloaded separately. The specification of these APIs are defined according to a Java Specification Request (JSR), and sometimes some of these APIs are later included in the core APIs of the platform (the most notable example of this kind is Swing).
  • unofficial APIs, developed by third parties, but not related to any JSRs.
java api1
Java API
  • For example Java Advanced Imaging (JAI) is a Java platform extension API that provides a set of object-oriented interfaces that support a simple, high-level programming model which allows developers to create their own image manipulation routines without the additional cost or licensing restrictions, associated with commercial image processing software.
java se programming
Java SE Programming
  • Install the followings
    • Java Runtime Environment (JRE)
    • Java Development Kit (JDK)
    • Netbeans IDE
java se programming1
Java SE Programming
  • Create a new Java project
    • Open NetBeans IDE
java se programming2
Java SE Programming
  • Go to File->New Project...
  • Select Javathen select Java Application
java se programming3
Java SE Programming
  • Click Next and enter Project Name then click Finish
java se programming4
Java SE Programming
  • .java file is created
  • Public class is created
  • Application entry point is created as main() function inside the class
java se programming6
Java SE Programming
  • Example
    • Declare a class as following inside the main class
java se programming7
Java SE Programming
  • Then write the code below inside the main() function
java se programming8
Java SE Programming
  • Run the application by pressing F6 button on the keyboard or click on the toolbars.
  • Then you should see the system output as below
ad