oop java l.
Skip this Video
Loading SlideShow in 5 Seconds..
OOP & JAVA PowerPoint Presentation
Download Presentation

Loading in 2 Seconds...

play fullscreen
1 / 12

OOP & JAVA - PowerPoint PPT Presentation

  • Uploaded on

OOP & JAVA. HelloWorld.java. /** * The HelloWorld class is an application that * displays " Hello World !" to the standard output . */ public class HelloWorld { // Display " Hello World !" public static void main ( String args []) { System . out . println (" Hello World !") ;

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


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
helloworld java

/** * The HelloWorld class is an application that * displays "Hello World!" to the standard output. */

public class HelloWorld {

// Display "Hello World!"

public static void main(String args[]) { System.out.println("Hello World!");



Compile: C:\> javac HelloWorld.java

Create java bytecode HelloWorld.class

Run: C:\> java HelloWorld

helloworld java applet
HelloWorld.java (Applet)



d efinitions of oop
Definitions of OOP
  • Class
    • A class defines the abstract characteristics of a thing (object), including the thing's characteristics (its attributes or properties) and the things it can do (its behaviors or methods or features).
    • For example, the class Dog would consist of traits shared by all dogs, for example breed, fur color, and the ability to bark.
d efinitions of oop5
Definitions of OOP
  • Object
    • The class of Dog defines all possible dogs by listing the characteristics that they can have; the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur; Lassie has brown-and-white fur.
    • In programmer jargon, the object Lassie is an instance of the Dog class. The set of values of the attributes of a particular object is called its state.
d efinitions of oop6
Definitions of OOP
  • Method
    • An object's abilities. Lassie, being a Dog, has the ability to bark. So bark() is one of Lassie's methods. She may have other methods as well, for example sit() or eat(). Within the program, using a method should only affect one particular object; all Dogs can bark, but you need one particular dog to do the barking.
d efinitions of oop7
Definitions of OOP
  • Message passing
    • "The process by which an object sends data to another object or asks the other object to invoke a method."
d efinitions of oop9
Definitions of OOP
  • Encapsulation 
    • Conceals the exact details of how a particular class works from objects that use its code or send messages to it. So, for example, the Dog class has a bark() method. The code for the bark() method defines exactly how a bark happens (e.g., by inhale() and then exhale(), at a particular pitch and volume).
d efinitions of oop10
Definitions of OOP
  • Polymorphism
    • is the ability of behavior to vary based on the conditions in which the behavior is invoked, that is, two or more methods, as well as operators (such as +, -, *, among others) can fit to many different conditions.
    • Ex. method signatures would be, respectively, very similar to add(int a, int b) and add(String a, String b). This is an example of Parametric Polymorphism. The returned type and used modifiers, of course, depend on the programmer interests and intentions.
java basics
JAVA basics
  • http://leepoint.net/notes-java/index.html
java s scope
Java’s Scope
  • Scope is a term used to define where a variable is defined.


Function eat(){

int money=100;

Print money;


Function buy(){

int money=200;

Print money;



int money=0;



Print money;