SlideShare a Scribd company logo
JAVA
       AuD©
JAVA
Introduction to java


Java is a object oriented programming language
which developed by James Gosling at Sun
Microsystems (which is now a subsidiary of Oracle
Corporation) and released in 1995 .
It is platform independent which can call as portable
Using java we can create interactive web pages or
program to PC or mobile
So Lets get started…………………………………
Introduction to java


Over 3.5 people learn java and using it day by day in
places like NASA , IBM and so.
Java was originally created for run simple web
applications.
What we can do??


Web servers
Relational databases
Orbiting telescopes
PDA
Cellular phones
Blue-ray disks
History of java


James Gosling, Mike Sheridan, and Patrick Naught on
initiated the Java language project in June 1991.Java
was originally designed for interactive television, but
it was too advanced for the digital cable television
industry at the time. The language was initially called
Oak after an oak tree that stood outside Gosling's
office; it went by the name Green later, and was later
renamed Java, from a list of random words. Gosling
aimed to implement a virtual machine and a language
that had a familiar C/C++ style of notation
Java programs


Java applications
  Java application is a program that run from command line
  interface
Java Applets
  Java applets are programs that run on web pages. It also
  compile on cmd but to run you must have web browser
Java servlet
  This is a special program that runs on web browser(for on line
  soft ware)
Advantages of java


Simple
  Java program left many of the unnecessary features of
  high level language
Object oriented
  Java programs use OOP concepts to create programs
Portable
  Java program can run in any flat form (Windows, Linux,
  mac OS X etc…) as long as it install Java runtime(JVM)
Advantages of java


Multithreaded
  Java program can perform several tasks @ same time
  which most of programming languages can’t;
Secure
High performance
Distributed
Dynamic
How java work
OOP

What Is an Object?
  An object is a software bundle of related state and
  behavior. Software objects are often used to model the
  real-world objects that you find in everyday life.
What is a class?
  Class is a collection of a objects with common
  properties.
Object


Software objects are conceptually similar to real-world
objects: they too consist of state and related behavior. An
object stores its state in fields (variables in some
programming languages) and exposes its behavior
through methods (functions in some programming
languages). Methods operate on an object's internal state
and serve as the primary mechanism for object-to-object
communication. Hiding internal state and requiring all
interaction to be performed through an object's methods
is known as data encapsulation — a fundamental principle
of object-oriented programming.
Object


Objects are key to understanding object-oriented
technology. Look around right now and you'll find many
examples of real-world objects: your dog, your desk, your
television set, your bicycle. Real-world objects share two
characteristics: They all have state and behavior.
   Dogs have state<attributes> (name, color, breed, hungry)
  and behavior (barking, fetching, wagging tail).
  Bicycles also have state (current gear, current pedal cadence,
  current speed) and behavior (changing gear, changing pedal
  cadence, applying brakes). Identifying the state and behavior
  for real-world objects is a great way to begin thinking in terms
  of object-oriented programming.
Class


In the real world, you'll often find many individual
objects all of the same kind. There may be thousands
of other bicycles in existence, all of the same make
and model. Each bicycle was built from the same set
of blueprints and therefore contains the same
components. In object-oriented terms, we say that
your bicycle is an instance of the class of objects
known as bicycles. A class is the blueprint from which
individual objects are created.
What Is Inheritance?



Different kinds of objects often have a certain amount in common with each
other. Mountain bikes, road bikes, and tandem bikes,

for example, all share the characteristics of bicycles (current speed, current
pedal cadence, current gear). Yet each also defines additional features that
make them different: tandem bicycles have two seats and two sets of
handlebars; road bikes have drop handlebars; some mountain bikes have an
additional chain ring, giving them a lower gear ratio.

 Object-oriented programming allows classes to inherit commonly used
state and behavior from other classes. In this example, Bicycle now
becomes the superclass of MountainBike, RoadBike, and TandemBike. In the
Java programming language, each class is allowed to have one direct
superclass, and each superclass has the potential for an unlimited number of
subclasses:
Inheritance
Interface


Interface makes the relationship between classes and
functionality to those classes implement easier to
understand and to design
A interface is a collection of methods that indicate a
class has some behavior in addition to what in inherits
from supper class;
Packages


Packages are use to grouping related classes and
interfaces
Java has many packages than make our work lot
easier
By default you have access to “java.lang” package;
For take advantages of other packages you must
import them
Setup your computer


Download java SE JDK
  http://www.oracle.com/technetwork/java/javase/downloads/index.ht
  ml
Install it
Set Path
All set & ready to write a program
Syntax


public class syntax{
public static void main(String args[]){
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
     }
}
Pro1


public class yourName{
public static void main(String args[]){
System.out.println(“IDM-Horana”);
     }
}
Variable


A variable is a place where information can be stored
while a program is running.
Kinds of variable
  Instance variable
  Local variable
Naming variable
  Name of variable must start with letter, “_”, “$”
  Can’t start with number
  Can’t use keyword to defining a variable
Keywords


abstract   continue    for          new         switch
assert     default     goto         package     synchronized
boolean    do          if           private     this
break      double      implements   protected   throw
byte       else        import       public      throws
case       enum        instanceof   return      transient
catch      extends     int          short       try
char       final       interface    static      void
class      finally     long         strictfp    volatile
const      float       native       super       while
Syntax


<datatype> <variableName>;

EX:

public cass variabeEx1{
public static void main(String args[]){
          int x;
          x=10;
          int y=20;
          int a,b,c;

}
}
Data types


Data Type                     Default Value (for fields)
byte                          0
short                         0
int                           0
long                          0L
float                         0.0f
double                        0.0d
char                          'u0000'
String (or any object)        null
boolean                       false
Examples

public class varEx1{
Public static void main(String args[]){
int a,b;
String c;
a=10;
b=15;
c=“IDM-Horana”
System.out.println(a);
System.out.println(b);
System.out.println(c);

}
}
Arrays
Array example

public class arrayEx1 {
 public static void main (String args[]){
     //Defining an array
     String[] array1;
     array1 = new String[5];

     //add data to array
     array1[0]="Aaliyah";
     array1[1]="Sera";
     array1[2]="Emma";
     array1[3]="Ely";
     array1[4]="Wendy";

     System.out.println(array1[0]);
     System.out.println(array1[1]);
     System.out.println(array1[2]);
     System.out.println(array1[3]);
     System.out.println(array1[4]);

 }
}
Operators

Operator Precedence
Operators              Precedence
postfix                expr++ expr--
unary                  ++expr --expr +expr -expr ~ !
multiplicative         */%
additive               +-
shift                  << >> >>>
relational             < > <= >= instanceof
equality               == !=
bitwise AND            &
bitwise exclusive OR   ^
bitwise inclusive OR   |
logical AND            &&
logical OR             ||
ternary                ?:
                       = += -= *= /= %= &= ^= |= <<= >>=
assignment
                       >>>=
Arithmetic Operators


+ additive operator (also used for String
concatenation) - subtraction operator
* multiplication operator
/ division operator
% remainder operator
Arithmetic Operators Example
class ArithmeticEx1 {
public static void main (String[] args){
 int result = 1 + 2;                     // result is now 3
System.out.println(result);
 result = result - 1;                     // result is now 2
System.out.println(result);
result = result * 2;                     // result is now 4
 System.out.println(result);
 result = result / 2;                    // result is now 2
 System.out.println(result);
result = result + 8;
System.out.println(result);              // result is now 10
 result = result % 7;
System.out.println(result);              // result is now 3
}}
Unary Operators


+ Unary plus operator; indicates positive value
(numbers are positive without this, however)
 - Unary minus operator; negates an expression
 ++ Increment operator; increments a value by 1
 -- Decrement operator; decrements a value by 1
 ! Logical complement operator; inverts the value of a
      boolean
Unary Operators Example


class UnaryEx1 {
 public static void main(String[] args){
 int result = +1;                  // result   is now 1
System.out.println(result);
result--;                          result is   now 0
System.out.println(result);
result++;                          // result   is now 1
System.out.println(result);
result = -result;                  // result   is now -1
System.out.println(result);
boolean success = false;
System.out.println(success);       // false
System.out.println(!success);      // true }   }
Comparison Operators


== equal to
!= not equal to
> greater than
>= greater than or equal to
< less than
<= less than or equal to
Comparison Operators Example


class ComparisonDemo {
public static void main(String[] args){
int value1 = 1;
int value2 = 2
if(value1 == value2) System.out.println("value1 == value2");
if(value1 != value2) System.out.println("value1 != value2");
if(value1 > value2) System.out.println("value1 > value2");
if(value1 < value2) System.out.println("value1 < value2");
if(value1 <= value2) System.out.println("value1 <= value2");
}
Flow Control


IF else
Switch
While
Do while
For
IF else
If else Example
import java.util.*;

class ifElseEx1{

public static void main(String args[]){
int x;
Scanner input=new Scanner(System.in);
System.out.print("Enter number for X:-");
x=input.nextInt();
if(x<=10){
System.out.println("X is less than 10");
}else{
System.out.println("X is Grater than 10");
}
}
}
import java.util.*;
                            More If else
class ifElseEx2 {
    public static void main(String args[]){
         //declaring variables
         int m1,m2,m3,tot;
         double avg;
         //inputs
         Scanner mark = new Scanner(System.in);
         System.out.print("Enert maek 1:-");
         m1=mark.nextInt();
         System.out.print("Enert maek 2:-");
         m2=mark.nextInt();
         System.out.print("Enert maek 3:-");
         m3=mark.nextInt();
         //calculations
         tot = m1+m2+m3;
         avg = tot/3;
         System.out.println("Total mark is:-"+tot);
         System.out.println("Average mark is:-"+avg);
         //Selecton
         if(tot>=210){
             System.out.println("You are Selected");
  }else{
             System.out.println("Try again");
         }
    }
}
Switch
import java.util.*;
class switchEx1 {

    public static void main(String args[]){
        int x;
        Scanner num=new Scanner(System.in);
        System.out.print("Enter root number:-");
        x=num.nextInt();

        switch(x){
            case 281:System.out.println("Thalgahawila-Horana");
            break;
            case 282:System.out.println("Padukka-Horana");
            break;
            case 315:System.out.println("Meepe-Horana");
            break;
            case 120:System.out.println("Colombo-Horana");
            break;
            case 450:System.out.println("Panadura-Horana");
            break;
            default:System.out.println("Enter valid root no");
        }

    }
}
While
While Example


public class flowWhile {

    public static void main(String []args){
        int a = 0;
        while(a<=10){
            System.out.println(a+"> AuD");
            a++;
        }
        System.out.println("Done");
    }

}
Do While
Do while Example


public class flowDoWhile {

    public static void main (String[] args){
        int x=0;
        do{
            System.out.println(x+"> AuD");
            x++;
          }
        while(x<=10);
    }
}
For
For Example


public class flowFor {
    public static void main(String args[]){
        for(int a=0;a<=10;a++){
            System.out.println(a+"> Aud");
        }
        System.out.println("Done........");

    }
}
Thank You
            AuD©

More Related Content

What's hot

Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxing
Geetha Manohar
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional Programming
RichardWarburton
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Yardena Meymann
 
Scala - brief intro
Scala - brief introScala - brief intro
Scala - brief intro
Razvan Cojocaru
 
Java Tut1
Java Tut1Java Tut1
Java Tut1
guest5c8bd1
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentalsHCMUTE
 
Getting Started With Scala
Getting Started With ScalaGetting Started With Scala
Getting Started With Scala
Xebia IT Architects
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
Binay Kumar Ray
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
Jonas Bonér
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
baabtra.com - No. 1 supplier of quality freshers
 
Functional Objects & Function and Closures
Functional Objects  & Function and ClosuresFunctional Objects  & Function and Closures
Functional Objects & Function and ClosuresSandip Kumar
 
Stepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to ScalaStepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to Scala
Derek Chen-Becker
 

What's hot (18)

Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxing
 
First fare 2010 java-introduction
First fare 2010 java-introductionFirst fare 2010 java-introduction
First fare 2010 java-introduction
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional Programming
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008
 
Scala - brief intro
Scala - brief introScala - brief intro
Scala - brief intro
 
Scala
ScalaScala
Scala
 
Java Tut1
Java Tut1Java Tut1
Java Tut1
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Getting Started With Scala
Getting Started With ScalaGetting Started With Scala
Getting Started With Scala
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
 
Csharp_Chap03
Csharp_Chap03Csharp_Chap03
Csharp_Chap03
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
 
Functional Objects & Function and Closures
Functional Objects  & Function and ClosuresFunctional Objects  & Function and Closures
Functional Objects & Function and Closures
 
Stepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to ScalaStepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to Scala
 

Similar to Java

Java Intro
Java IntroJava Intro
Java Introbackdoor
 
Java for android developers
Java for android developersJava for android developers
Java for android developers
Aly Abdelkareem
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
Martin Odersky
 
Knowledge of Javascript
Knowledge of JavascriptKnowledge of Javascript
Knowledge of Javascript
Samuel Abraham
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
Julie Iskander
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
Felipe
 
Programming Android Application in Scala.
Programming Android Application in Scala.Programming Android Application in Scala.
Programming Android Application in Scala.
Brian Hsu
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
Abbas Raza
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
Jamie (Taka) Wang
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
Abhijeet Dubey
 
Java tut1
Java tut1Java tut1
Java tut1
Ajmal Khan
 
Tutorial java
Tutorial javaTutorial java
Tutorial java
Abdul Aziz
 
JavaScript(Es5) Interview Questions & Answers
JavaScript(Es5)  Interview Questions & AnswersJavaScript(Es5)  Interview Questions & Answers
JavaScript(Es5) Interview Questions & Answers
Ratnala Charan kumar
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
Wien15 java8
Wien15 java8Wien15 java8
Wien15 java8
Jaanus Pöial
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
VijalJain3
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
Ganesh Samarthyam
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard Library
Santosh Rajan
 

Similar to Java (20)

Java Intro
Java IntroJava Intro
Java Intro
 
Java for android developers
Java for android developersJava for android developers
Java for android developers
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 
Knowledge of Javascript
Knowledge of JavascriptKnowledge of Javascript
Knowledge of Javascript
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
Programming Android Application in Scala.
Programming Android Application in Scala.Programming Android Application in Scala.
Programming Android Application in Scala.
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
Scala ntnu
Scala ntnuScala ntnu
Scala ntnu
 
Java tut1
Java tut1Java tut1
Java tut1
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Tutorial java
Tutorial javaTutorial java
Tutorial java
 
JavaScript(Es5) Interview Questions & Answers
JavaScript(Es5)  Interview Questions & AnswersJavaScript(Es5)  Interview Questions & Answers
JavaScript(Es5) Interview Questions & Answers
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Wien15 java8
Wien15 java8Wien15 java8
Wien15 java8
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard Library
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 

Java

  • 1. JAVA AuD©
  • 2.
  • 4. Introduction to java Java is a object oriented programming language which developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 . It is platform independent which can call as portable Using java we can create interactive web pages or program to PC or mobile So Lets get started…………………………………
  • 5. Introduction to java Over 3.5 people learn java and using it day by day in places like NASA , IBM and so. Java was originally created for run simple web applications.
  • 6. What we can do?? Web servers Relational databases Orbiting telescopes PDA Cellular phones Blue-ray disks
  • 7. History of java James Gosling, Mike Sheridan, and Patrick Naught on initiated the Java language project in June 1991.Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. The language was initially called Oak after an oak tree that stood outside Gosling's office; it went by the name Green later, and was later renamed Java, from a list of random words. Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation
  • 8. Java programs Java applications Java application is a program that run from command line interface Java Applets Java applets are programs that run on web pages. It also compile on cmd but to run you must have web browser Java servlet This is a special program that runs on web browser(for on line soft ware)
  • 9. Advantages of java Simple Java program left many of the unnecessary features of high level language Object oriented Java programs use OOP concepts to create programs Portable Java program can run in any flat form (Windows, Linux, mac OS X etc…) as long as it install Java runtime(JVM)
  • 10. Advantages of java Multithreaded Java program can perform several tasks @ same time which most of programming languages can’t; Secure High performance Distributed Dynamic
  • 12. OOP What Is an Object? An object is a software bundle of related state and behavior. Software objects are often used to model the real-world objects that you find in everyday life. What is a class? Class is a collection of a objects with common properties.
  • 13. Object Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.
  • 14. Object Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior. Dogs have state<attributes> (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object-oriented programming.
  • 15. Class In the real world, you'll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles. A class is the blueprint from which individual objects are created.
  • 16. What Is Inheritance? Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio. Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses:
  • 18. Interface Interface makes the relationship between classes and functionality to those classes implement easier to understand and to design A interface is a collection of methods that indicate a class has some behavior in addition to what in inherits from supper class;
  • 19. Packages Packages are use to grouping related classes and interfaces Java has many packages than make our work lot easier By default you have access to “java.lang” package; For take advantages of other packages you must import them
  • 20. Setup your computer Download java SE JDK http://www.oracle.com/technetwork/java/javase/downloads/index.ht ml Install it Set Path All set & ready to write a program
  • 21. Syntax public class syntax{ public static void main(String args[]){ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ } }
  • 22. Pro1 public class yourName{ public static void main(String args[]){ System.out.println(“IDM-Horana”); } }
  • 23. Variable A variable is a place where information can be stored while a program is running. Kinds of variable Instance variable Local variable Naming variable Name of variable must start with letter, “_”, “$” Can’t start with number Can’t use keyword to defining a variable
  • 24. Keywords abstract continue for new switch assert default goto package synchronized boolean do if private this break double implements protected throw byte else import public throws case enum instanceof return transient catch extends int short try char final interface static void class finally long strictfp volatile const float native super while
  • 25. Syntax <datatype> <variableName>; EX: public cass variabeEx1{ public static void main(String args[]){ int x; x=10; int y=20; int a,b,c; } }
  • 26. Data types Data Type Default Value (for fields) byte 0 short 0 int 0 long 0L float 0.0f double 0.0d char 'u0000' String (or any object) null boolean false
  • 27. Examples public class varEx1{ Public static void main(String args[]){ int a,b; String c; a=10; b=15; c=“IDM-Horana” System.out.println(a); System.out.println(b); System.out.println(c); } }
  • 29. Array example public class arrayEx1 { public static void main (String args[]){ //Defining an array String[] array1; array1 = new String[5]; //add data to array array1[0]="Aaliyah"; array1[1]="Sera"; array1[2]="Emma"; array1[3]="Ely"; array1[4]="Wendy"; System.out.println(array1[0]); System.out.println(array1[1]); System.out.println(array1[2]); System.out.println(array1[3]); System.out.println(array1[4]); } }
  • 30. Operators Operator Precedence Operators Precedence postfix expr++ expr-- unary ++expr --expr +expr -expr ~ ! multiplicative */% additive +- shift << >> >>> relational < > <= >= instanceof equality == != bitwise AND & bitwise exclusive OR ^ bitwise inclusive OR | logical AND && logical OR || ternary ?: = += -= *= /= %= &= ^= |= <<= >>= assignment >>>=
  • 31. Arithmetic Operators + additive operator (also used for String concatenation) - subtraction operator * multiplication operator / division operator % remainder operator
  • 32. Arithmetic Operators Example class ArithmeticEx1 { public static void main (String[] args){ int result = 1 + 2; // result is now 3 System.out.println(result); result = result - 1; // result is now 2 System.out.println(result); result = result * 2; // result is now 4 System.out.println(result); result = result / 2; // result is now 2 System.out.println(result); result = result + 8; System.out.println(result); // result is now 10 result = result % 7; System.out.println(result); // result is now 3 }}
  • 33. Unary Operators + Unary plus operator; indicates positive value (numbers are positive without this, however) - Unary minus operator; negates an expression ++ Increment operator; increments a value by 1 -- Decrement operator; decrements a value by 1 ! Logical complement operator; inverts the value of a boolean
  • 34. Unary Operators Example class UnaryEx1 { public static void main(String[] args){ int result = +1; // result is now 1 System.out.println(result); result--; result is now 0 System.out.println(result); result++; // result is now 1 System.out.println(result); result = -result; // result is now -1 System.out.println(result); boolean success = false; System.out.println(success); // false System.out.println(!success); // true } }
  • 35. Comparison Operators == equal to != not equal to > greater than >= greater than or equal to < less than <= less than or equal to
  • 36. Comparison Operators Example class ComparisonDemo { public static void main(String[] args){ int value1 = 1; int value2 = 2 if(value1 == value2) System.out.println("value1 == value2"); if(value1 != value2) System.out.println("value1 != value2"); if(value1 > value2) System.out.println("value1 > value2"); if(value1 < value2) System.out.println("value1 < value2"); if(value1 <= value2) System.out.println("value1 <= value2"); }
  • 39. If else Example import java.util.*; class ifElseEx1{ public static void main(String args[]){ int x; Scanner input=new Scanner(System.in); System.out.print("Enter number for X:-"); x=input.nextInt(); if(x<=10){ System.out.println("X is less than 10"); }else{ System.out.println("X is Grater than 10"); } } }
  • 40. import java.util.*; More If else class ifElseEx2 { public static void main(String args[]){ //declaring variables int m1,m2,m3,tot; double avg; //inputs Scanner mark = new Scanner(System.in); System.out.print("Enert maek 1:-"); m1=mark.nextInt(); System.out.print("Enert maek 2:-"); m2=mark.nextInt(); System.out.print("Enert maek 3:-"); m3=mark.nextInt(); //calculations tot = m1+m2+m3; avg = tot/3; System.out.println("Total mark is:-"+tot); System.out.println("Average mark is:-"+avg); //Selecton if(tot>=210){ System.out.println("You are Selected"); }else{ System.out.println("Try again"); } } }
  • 41. Switch import java.util.*; class switchEx1 { public static void main(String args[]){ int x; Scanner num=new Scanner(System.in); System.out.print("Enter root number:-"); x=num.nextInt(); switch(x){ case 281:System.out.println("Thalgahawila-Horana"); break; case 282:System.out.println("Padukka-Horana"); break; case 315:System.out.println("Meepe-Horana"); break; case 120:System.out.println("Colombo-Horana"); break; case 450:System.out.println("Panadura-Horana"); break; default:System.out.println("Enter valid root no"); } } }
  • 42. While
  • 43. While Example public class flowWhile { public static void main(String []args){ int a = 0; while(a<=10){ System.out.println(a+"> AuD"); a++; } System.out.println("Done"); } }
  • 45. Do while Example public class flowDoWhile { public static void main (String[] args){ int x=0; do{ System.out.println(x+"> AuD"); x++; } while(x<=10); } }
  • 46. For
  • 47. For Example public class flowFor { public static void main(String args[]){ for(int a=0;a<=10;a++){ System.out.println(a+"> Aud"); } System.out.println("Done........"); } }
  • 48. Thank You AuD©

Editor's Notes

  1. Property of AuD©
  2. Property of AuD©