Top Banner
Java & Java Java & Java Applets Applets a brief introduction a brief introduction By By Dereklis Leonidas Dereklis Leonidas for the for the Network Operations Center of Network Operations Center of Aristotle University of Aristotle University of Thessalniki Thessalniki 18/4/2006 18/4/2006
33

Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Dec 22, 2015

Download

Documents

Sydney Woods
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Java & Java AppletsJava & Java Appletsa brief introductiona brief introduction

By By Dereklis LeonidasDereklis Leonidasfor the for the

Network Operations Center of Aristotle Network Operations Center of Aristotle University of Thessalniki University of Thessalniki

18/4/200618/4/2006

Page 2: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

What is Java?What is Java? Java coffee is a coffee produced on the island of Java. is an island of Java coffee is a coffee produced on the island of Java. is an island of

Indonesia, and the site of its capital city, Jakarta. It is the most populous Indonesia, and the site of its capital city, Jakarta. It is the most populous island in the world; indeed it has a larger population than either the island in the world; indeed it has a larger population than either the continents of Australia or Antarctica (see the list of islands by population). continents of Australia or Antarctica (see the list of islands by population). en.wikipedia.org/wiki/Java_(coffee)en.wikipedia.org/wiki/Java_(coffee)

Java is a German-style board game designed by Wolfgang Kramer and Java is a German-style board game designed by Wolfgang Kramer and Michael Kiesling and published in 2000 by Ravensburger in German and Michael Kiesling and published in 2000 by Ravensburger in German and by Rio Grande Games in English. by Rio Grande Games in English. en.wikipedia.org/wiki/Java_(board_game)en.wikipedia.org/wiki/Java_(board_game)

Java is an object-oriented programming language developed Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that replace C++, although the feature set better resembles that of Objective C. Java should not be confused with of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates syntax. Sun Microsystems currently maintains and updates Java regularly. Java regularly. en.wikipedia.org/wiki/Java_(language)en.wikipedia.org/wiki/Java_(language)

Page 3: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

11999955

JJaavvaa tteecchhnnoollooggyy rreelleeaasseedd ttoo aa sseelleecctt ggrroouupp oonn tthhee WWeebb ssiittee wwiicckkeedd..nneeaattoo..oorrgg

TThhee SSaann JJoossee MMeerrccuurryy NNeewwss rruunnss aa ffrroonntt--ppaaggee aarrttiiccllee aabboouutt JJaavvaa tteecchhnnoollooggyy

NNaammee cchhaannggeedd ffrroomm ""OOaakk"" ttoo ""JJaavvaa""

AAnnnnoouunncceedd aatt SSuunn WWoorrlldd ---- JJaavvaa tteecchhnnoollooggyy iiss ooffffiicciiaallllyy bboorrnn

11999966

TThhee ffiirrsstt JJaavvaaOOnnee DDeevveellooppeerr CCoonnffeerreennccee

JJDDKKttmm 11..00 ssooffttwwaarree iiss rreelleeaasseedd

CChheessss ccoommppuutteerr DDeeeepp BBlluuee ddeeffeeaattss GGaarrrryy KKaassppaarroovv ffoorr tthhee ffiirrsstt ttiimmee

""DDoollllyy"" tthhee ffiirrsstt cclloonneedd sshheeeepp iiss bboorrnn

11999977

OOvveerr 222200,,000000 ddoowwnnllooaaddss ooff JJDDKK 11..11 ssooffttwwaarree ooccccuurr iinn jjuusstt tthhrreeee wweeeekkss

JJaavvaaOOnnee ddrraawwss 88,,000000 aatttteennddeeeess,, bbeeccoommiinngg tthhee wwoorrlldd’’ss llaarrggeesstt ddeevveellooppeerr ccoonnffeerreennccee

JJaavvaa CCaarrdd 22..00 ppllaattffoorrmm iiss uunnvveeiilleedd

4433%% ooff UU..SS.. ffaammiilliieess oowwnn aa ccoommppuutteerr

11999988

JJDDKK 11..11 rreelleeaassee ddoowwnnllooaaddss ttoopp 22 mmiilllliioonn

VViissaa llaauunncchheess wwoorrlldd’’ss ffiirrsstt ssmmaarrtt ccaarrdd bbaasseedd oonn JJaavvaa CCaarrdd tteecchhnnoollooggyy

TThhee JJaavvaa CCoommmmuunniittyy PPrroocceessss ((JJCCPP)) pprrooggrraamm ffoorrmmaalliizzeedd

""WWhhoo WWaannttss ttoo BBee aa MMiilllliioonnaaiirree??"" pprreemmiieerreess iinn tthhee UU..KK

11999999

JJaavvaa 22 ppllaattffoorrmm ssoouurrccee ccooddee iiss rreelleeaasseedd

JJaavvaaOOnnee ddrraawwss 2200,,000000

JJ22EEEE bbeettaa ssooffttwwaarree iiss rreelleeaasseedd

""SSttaarr WWaarrss EEppiissooddee II:: TThhee PPhhaannttoomm MMeennaaccee"" rreelleeaasseedd

22000000

OOvveerr 440000 JJaavvaa UUsseerr GGrroouuppss aarree eessttaabblliisshheedd wwoorrllddwwiiddee

JJaavvaa DDeevveellooppeerr CCoonnnneeccttiioonn pprrooggrraamm ttooppss 11..55 mmiilllliioonn mmeemmbbeerrss

SStteevvee JJoobbss jjooiinnss SSccootttt MMccNNeeaallyy oonn ssttaaggee aatt JJaavvaaOOnnee ttoo aannnnoouunnccee aa mmaajjoorr ccoommmmiittmmeenntt bbyy AAppppllee iinn ssuuppppoorrtt ooff JJaavvaa tteecchhnnoollooggyy

HHeeaavvyy MMeettaall bbaanndd MMeettaalllliiccaa ssuueess NNaappsstteerr ffoorr ccooppyyrriigghhtt vviioollaattiioonnss

22000011

FFiirrsstt iinntteerrnnaattiioonnaall JJaavvaaOOnnee ccoonnffeerreennccee iinn YYookkoohhaammaa JJaappaann

OOvveerr 11 mmiilllliioonn ddoowwnnllooaaddss ooff tthhee JJaavvaa PPllaattffoorrmm,, EEnntteerrpprriissee EEddiittiioonn ((JJaavvaa EEEE)) SSDDKK

GGooooggllee IInncc.. PPaaggeeRRaannkk sseeaarrcchh aallggoorriitthhmm ppaatteenntt aawwaarrddeedd

""TThhee LLoorrdd ooff tthhee RRiinnggss:: TThhee FFeelllloowwsshhiipp ooff tthhee RRiinngg"" iiss rreelleeaasseedd

22000022

JJ22EEEE SSDDKK ddoowwnnllooaaddss rreeaacchh 22 mmiilllliioonn

7788%% ooff eexxeeccuuttiivveess vviieeww JJ22EEEE tteecchhnnoollooggyy aass tthhee mmoosstt eeffffeeccttiivvee ppllaattffoorrmm ffoorr bbuuiillddiinngg aanndd ddeeppllooyyiinngg WWeebb sseerrvviicceess

TThhee EEuurroo iiss iinnttrroodduucceedd

""TThhee OOssbboouurrnneess"" bbeeccoommeess aa ssuurrpprriissee hhiitt oonn MMTTVV

22000033

JJaavvaa tteecchhnnoollooggyy rruunnss iinn aallmmoosstt 555500 mmiilllliioonn ddeesskkttooppss

AAllmmoosstt 7755%% ooff pprrooffeessssiioonnaall ddeevveellooppeerrss uussee JJaavvaa pprrooggrraammmmiinngg llaanngguuaaggee aass tthheeiirr pprriimmaarryy ddeevveellooppmmeenntt llaanngguuaaggee

CCoommmmeerrcciiaall VVooiiccee--OOvveerr--IInntteerrnneett ((VVooiiPP)) pphhoonnee sseerrvviiccee bbeeggiinnss

""TThhee DDaa VViinnccii CCooddee"" iiss ppuubblliisshheedd

22000044

JJaavvaa 22 PPllaattffoorrmm,, SSttaannddaarrdd EEddiittiioonn 55 ((PPrroojjeecctt TTiiggeerr)) iiss rreelleeaasseedd

TThhee JJaavvaa tteecchhnnoollooggyy--ppoowweerreedd MMaarrss RRoovveerr ((SSppiirriitt)) ttoouucchheess ddoowwnn oonn MMaarrss

SSuunn JJaavvaa SSttuuddiioo CCrreeaattoorr iiss llaauunncchheedd

22000055

JJaavvaa tteecchhnnoollooggyy cceelleebbrraatteess iittss 1100tthh bbiirrtthhddaayy

AApppprrooxxiimmaatteellyy 44..55 mmiilllliioonn ddeevveellooppeerrss uussee JJaavvaa tteecchhnnoollooggyy

OOvveerr 22..55 bbiilllliioonn JJaavvaa tteecchhnnoollooggyy--eennaabblleedd ddeevviicceess aarree aavvaaiillaabbllee

jjaavvaa..ccoomm bbuunnddlleess tthhee GGooooggllee TToooollbbaarr wwiitthh tthhee JJRREE ddoowwnnllooaadd

11999955

JJaavvaa tteecchhnnoollooggyy rreelleeaasseedd ttoo aa sseelleecctt ggrroouupp oonn tthhee WWeebb ssiittee wwiicckkeedd..nneeaattoo..oorrgg

TThhee SSaann JJoossee MMeerrccuurryy NNeewwss rruunnss aa ffrroonntt--ppaaggee aarrttiiccllee aabboouutt JJaavvaa tteecchhnnoollooggyy

NNaammee cchhaannggeedd ffrroomm ""OOaakk"" ttoo ""JJaavvaa""

AAnnnnoouunncceedd aatt SSuunn WWoorrlldd ---- JJaavvaa tteecchhnnoollooggyy iiss ooffffiicciiaallllyy bboorrnn

11999966

TThhee ffiirrsstt JJaavvaaOOnnee DDeevveellooppeerr CCoonnffeerreennccee

JJDDKKttmm 11..00 ssooffttwwaarree iiss rreelleeaasseedd

CChheessss ccoommppuutteerr DDeeeepp BBlluuee ddeeffeeaattss GGaarrrryy KKaassppaarroovv ffoorr tthhee ffiirrsstt ttiimmee

""DDoollllyy"" tthhee ffiirrsstt cclloonneedd sshheeeepp iiss bboorrnn

11999977

OOvveerr 222200,,000000 ddoowwnnllooaaddss ooff JJDDKK 11..11 ssooffttwwaarree ooccccuurr iinn jjuusstt tthhrreeee wweeeekkss

JJaavvaaOOnnee ddrraawwss 88,,000000 aatttteennddeeeess,, bbeeccoommiinngg tthhee wwoorrlldd’’ss llaarrggeesstt ddeevveellooppeerr ccoonnffeerreennccee

JJaavvaa CCaarrdd 22..00 ppllaattffoorrmm iiss uunnvveeiilleedd

4433%% ooff UU..SS.. ffaammiilliieess oowwnn aa ccoommppuutteerr

11999988

JJDDKK 11..11 rreelleeaassee ddoowwnnllooaaddss ttoopp 22 mmiilllliioonn

VViissaa llaauunncchheess wwoorrlldd’’ss ffiirrsstt ssmmaarrtt ccaarrdd bbaasseedd oonn JJaavvaa CCaarrdd tteecchhnnoollooggyy

TThhee JJaavvaa CCoommmmuunniittyy PPrroocceessss ((JJCCPP)) pprrooggrraamm ffoorrmmaalliizzeedd

""WWhhoo WWaannttss ttoo BBee aa MMiilllliioonnaaiirree??"" pprreemmiieerreess iinn tthhee UU..KK

11999999

JJaavvaa 22 ppllaattffoorrmm ssoouurrccee ccooddee iiss rreelleeaasseedd

JJaavvaaOOnnee ddrraawwss 2200,,000000

JJ22EEEE bbeettaa ssooffttwwaarree iiss rreelleeaasseedd

""SSttaarr WWaarrss EEppiissooddee II:: TThhee PPhhaannttoomm MMeennaaccee"" rreelleeaasseedd

22000000

OOvveerr 440000 JJaavvaa UUsseerr GGrroouuppss aarree eessttaabblliisshheedd wwoorrllddwwiiddee

JJaavvaa DDeevveellooppeerr CCoonnnneeccttiioonn pprrooggrraamm ttooppss 11..55 mmiilllliioonn mmeemmbbeerrss

SStteevvee JJoobbss jjooiinnss SSccootttt MMccNNeeaallyy oonn ssttaaggee aatt JJaavvaaOOnnee ttoo aannnnoouunnccee aa mmaajjoorr ccoommmmiittmmeenntt bbyy AAppppllee iinn ssuuppppoorrtt ooff JJaavvaa tteecchhnnoollooggyy

HHeeaavvyy MMeettaall bbaanndd MMeettaalllliiccaa ssuueess NNaappsstteerr ffoorr ccooppyyrriigghhtt vviioollaattiioonnss

22000011

FFiirrsstt iinntteerrnnaattiioonnaall JJaavvaaOOnnee ccoonnffeerreennccee iinn YYookkoohhaammaa JJaappaann

OOvveerr 11 mmiilllliioonn ddoowwnnllooaaddss ooff tthhee JJaavvaa PPllaattffoorrmm,, EEnntteerrpprriissee EEddiittiioonn ((JJaavvaa EEEE)) SSDDKK

GGooooggllee IInncc.. PPaaggeeRRaannkk sseeaarrcchh aallggoorriitthhmm ppaatteenntt aawwaarrddeedd

""TThhee LLoorrdd ooff tthhee RRiinnggss:: TThhee FFeelllloowwsshhiipp ooff tthhee RRiinngg"" iiss rreelleeaasseedd

22000022

JJ22EEEE SSDDKK ddoowwnnllooaaddss rreeaacchh 22 mmiilllliioonn

7788%% ooff eexxeeccuuttiivveess vviieeww JJ22EEEE tteecchhnnoollooggyy aass tthhee mmoosstt eeffffeeccttiivvee ppllaattffoorrmm ffoorr bbuuiillddiinngg aanndd ddeeppllooyyiinngg WWeebb sseerrvviicceess

TThhee EEuurroo iiss iinnttrroodduucceedd

""TThhee OOssbboouurrnneess"" bbeeccoommeess aa ssuurrpprriissee hhiitt oonn MMTTVV

22000033

JJaavvaa tteecchhnnoollooggyy rruunnss iinn aallmmoosstt 555500 mmiilllliioonn ddeesskkttooppss

AAllmmoosstt 7755%% ooff pprrooffeessssiioonnaall ddeevveellooppeerrss uussee JJaavvaa pprrooggrraammmmiinngg llaanngguuaaggee aass tthheeiirr pprriimmaarryy ddeevveellooppmmeenntt llaanngguuaaggee

CCoommmmeerrcciiaall VVooiiccee--OOvveerr--IInntteerrnneett ((VVooiiPP)) pphhoonnee sseerrvviiccee bbeeggiinnss

""TThhee DDaa VViinnccii CCooddee"" iiss ppuubblliisshheedd

22000044

JJaavvaa 22 PPllaattffoorrmm,, SSttaannddaarrdd EEddiittiioonn 55 ((PPrroojjeecctt TTiiggeerr)) iiss rreelleeaasseedd

TThhee JJaavvaa tteecchhnnoollooggyy--ppoowweerreedd MMaarrss RRoovveerr ((SSppiirriitt)) ttoouucchheess ddoowwnn oonn MMaarrss

SSuunn JJaavvaa SSttuuddiioo CCrreeaattoorr iiss llaauunncchheedd

22000055

JJaavvaa tteecchhnnoollooggyy cceelleebbrraatteess iittss 1100tthh bbiirrtthhddaayy

AApppprrooxxiimmaatteellyy 44..55 mmiilllliioonn ddeevveellooppeerrss uussee JJaavvaa tteecchhnnoollooggyy

OOvveerr 22..55 bbiilllliioonn JJaavvaa tteecchhnnoollooggyy--eennaabblleedd ddeevviicceess aarree aavvaaiillaabbllee

jjaavvaa..ccoomm bbuunnddlleess tthhee GGooooggllee TToooollbbaarr wwiitthh tthhee JJRREE ddoowwnnllooaadd

19951995: : Java technology released to a select group on the Web site wicked.neato.orgJava technology released to a select group on the Web site wicked.neato.orgThe San Jose Mercury News runs a front-page article about Java technologyThe San Jose Mercury News runs a front-page article about Java technologyName changed from "Oak" to "Java"Name changed from "Oak" to "Java"Announced at Sun World -- Java technology is officially bornAnnounced at Sun World -- Java technology is officially born

19961996:: The first JavaOneThe first JavaOne Developer ConferenceDeveloper ConferenceJDKtm 1.0 software is releasedJDKtm 1.0 software is released

19971997:: Over 220,000 downloads of JDK 1.1 software occur in just three weeksOver 220,000 downloads of JDK 1.1 software occur in just three weeksJavaOne draws 8,000 attendees, becoming the world’s largest developer conferenceJavaOne draws 8,000 attendees, becoming the world’s largest developer conferenceJava Card 2.0 platform is unveiledJava Card 2.0 platform is unveiled

19981998:: JDK 1.1 release downloads top 2 millionJDK 1.1 release downloads top 2 millionVisa launches world’s first smart card based on Java Card technologyVisa launches world’s first smart card based on Java Card technologyThe Java Community Process (JCP) program formalizedThe Java Community Process (JCP) program formalized

19991999:: Java 2 platform source code is releasedJava 2 platform source code is releasedJavaOne draws 20,000JavaOne draws 20,000J2EE beta software is releasedJ2EE beta software is released

20002000:: Over 400 Java User Groups are established worldwideOver 400 Java User Groups are established worldwideJava Developer Connection program tops 1.5 million membersJava Developer Connection program tops 1.5 million membersSteve Jobs joins Scott McNealy on stage at JavaOne to announce a major commitment by Apple in Steve Jobs joins Scott McNealy on stage at JavaOne to announce a major commitment by Apple in support of Java technologysupport of Java technology

20012001:: First international JavaOne conference in Yokohama JapanFirst international JavaOne conference in Yokohama JapanOver 1 million downloads of the Java Platform, Enterprise Edition (Java EE) SDKOver 1 million downloads of the Java Platform, Enterprise Edition (Java EE) SDK

20022002:: J2EE SDK downloads reach 2 millionJ2EE SDK downloads reach 2 million78% of executives view J2EE technology as the most effective platform for building and 78% of executives view J2EE technology as the most effective platform for building and

deploying Web servicesdeploying Web services20032003:: Java technology runs in almost 550 million desktopsJava technology runs in almost 550 million desktops

Almost 75% of professional developers use Java programming language as their primary Almost 75% of professional developers use Java programming language as their primary development languagedevelopment language20042004:: Java 2 Platform, Standard Edition 5 (Project Tiger) is releasedJava 2 Platform, Standard Edition 5 (Project Tiger) is released

The Java technology-powered Mars Rover (Spirit) touches down on MarsThe Java technology-powered Mars Rover (Spirit) touches down on MarsSun Java Studio Creator is launchedSun Java Studio Creator is launched

20052005:: Java technology celebrates its 10th birthdayJava technology celebrates its 10th birthdayApproximately 4.5 million developers use Java technologyApproximately 4.5 million developers use Java technologyOver 2.5 billion Java technology-enabled devices are availableOver 2.5 billion Java technology-enabled devices are availablejava.com bundles the Google Toolbar with the JRE downloadjava.com bundles the Google Toolbar with the JRE download

Page 4: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Why Java?Why Java? Similar to C++ so it is familiar to commercial programmers. Similar to C++ so it is familiar to commercial programmers. Does not include the nasty dangerous parts of C++ so it is safe. Does not include the nasty dangerous parts of C++ so it is safe. Extensive run-time type information and safe dynamic link-loading is Extensive run-time type information and safe dynamic link-loading is

available. available. Includes string and multi-thread support in the language. Includes string and multi-thread support in the language. Automatic memory management. Automatic memory management. Data type sizes and arithmetic behaviour are fixed and fully defined for all Data type sizes and arithmetic behaviour are fixed and fully defined for all

platforms. platforms. Has useful standard OO libraries. Has useful standard OO libraries. Documentation can be extracted from the source code. Documentation can be extracted from the source code. Security checking is built in to the libraries and virtual machine. Security checking is built in to the libraries and virtual machine. Supports unicode for ease of internationalisation. Supports unicode for ease of internationalisation. Write once, run anywhere, any platform (no porting, no client configuration .. Write once, run anywhere, any platform (no porting, no client configuration ..

well almost!) well almost!) Vast amount of supplier and programmer support and acceptance. It is Vast amount of supplier and programmer support and acceptance. It is

unkillable. unkillable. Loads and runs over the WWW, 40 million potential clients. Loads and runs over the WWW, 40 million potential clients.

Page 5: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Data Data TypeType

MinimumMinimum MaximumMaximum DefaultDefault

ByteByte -128-128 127127 00

ShortShort -32768-32768 3276732767 00

IntInt --21474836482147483648 21474836421474836477 00

LongLong --92233720368547758089223372036854775808 92233720368547759223372036854775808077

00

FloatFloat 1.40239846e-451.40239846e-45 3.40282347e+383.40282347e+38 00

DoubleDouble 4.94065645841246544e-4.94065645841246544e-324324

1.7976931348623151.7976931348623157e+3087e+308

00

Page 6: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

1. 1. The The booleanboolean data type may take one of the two values data type may take one of the two values truetrue or or falsefalse

2. 2. The The charchar data type can take any value out of the data type can take any value out of the character set of the computer systemcharacter set of the computer system

3. There is also the 3. There is also the String String data type that can store strings.data type that can store strings.

A variable type governs how much storage space is A variable type governs how much storage space is made available for the specific variable, for example int made available for the specific variable, for example int uses 32 bits, long and double use 64 bitsuses 32 bits, long and double use 64 bits

Page 7: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

AdditionAddition ++ SubtractionSubtraction -- MultiplicationMultiplication ** DivisionDivision // ModulusModulus %%

OperatorsOperators

Java provides several operators for abbreviating Java provides several operators for abbreviating assignment expressionsassignment expressions

Addition assignment Addition assignment += //instead of x = x+5, x+=5+= //instead of x = x+5, x+=5 Subtraction assignmentSubtraction assignment -=-= Multiplication assignment *=Multiplication assignment *= Division assignmentDivision assignment /=/= Modulus assignmentModulus assignment %=%=

Equal toEqual to = == = Not equal toNot equal to !=!= Greater thanGreater than >> Less thanLess than << Greater than or equal >=Greater than or equal >= Less than or equalLess than or equal <=<=

Page 8: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Boolean (Logical) OperatorsBoolean (Logical) Operators

Logical ANDLogical AND & or &&& or && Logical ORLogical OR | or ||| or ||

The difference is that with the double sign, The difference is that with the double sign, if the first argument is false, the second is if the first argument is false, the second is not checked.not checked.

Exclusive ORExclusive OR ^̂ Logical NOTLogical NOT !!

Page 9: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

How Java Runs?How Java Runs?

Page 10: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

What are the main parts of a Java What are the main parts of a Java Application?Application?

What we actually program in Java are What we actually program in Java are CLASSESCLASSES

Classes contain information of the future Classes contain information of the future objects that will be created during executionobjects that will be created during execution

The structure of a Java class is the followingThe structure of a Java class is the following Declaration of VariablesDeclaration of Variables Constructor(s)Constructor(s) MethodsMethodsSee example in the next page See example in the next page

Page 11: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Hello World ProgramHello World Programclass class classNameclassName{ //If it is a public class it must have the same { //If it is a public class it must have the same

name with the .java file name with the .java file//Variables//VariablesString String myStringmyString;;//Constructor (has the same name as the class)//Constructor (has the same name as the class)public void className(){public void className(){

myString = “Hello World”; /*This creates a string myString = “Hello World”; /*This creates a string literal. literal. If we want to create an object we If we want to create an object we write: write: myString = new String(“Hello myString = new String(“Hello World”);*/World”);*/}}void display(){ //Void means it doesn’t return anythingvoid display(){ //Void means it doesn’t return anything

System.out.println(myString);System.out.println(myString);}}

}}

Page 12: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

How to run our program?How to run our program?

This class will compile but it cannot run. Runnable classes in This class will compile but it cannot run. Runnable classes in Java must contain a MAIN method. So to run our program we Java must contain a MAIN method. So to run our program we create a tester.create a tester.Class myTester{Class myTester{

public static void main(String[] args){public static void main(String[] args){className myClass = new className();className myClass = new className();

/*We create an object of type className /*We create an object of type className giving it the name “myClass”*/giving it the name “myClass”*/

myClass.display(); //We run method “display” of myClass.display(); //We run method “display” of //the object we created.//the object we created.

}}}}

Page 13: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Compiling and Running Compiling and Running our Programour Program

Compile and RunCompile and RunTo compile your program type:To compile your program type:

javac Ex1.javajavac Ex1.java

To run (execute) your programTo run (execute) your program

java Ex1 java Ex1

Page 14: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Another simple exampleAnother simple example The Java codeThe Java code

public class Ex1 { public class Ex1 {

public static void main(String args[]) {public static void main(String args[]) {

int Hours;int Hours;

int Rate;int Rate;

int GrossPay;int GrossPay;

Hours=40;Hours=40;

Rate=4;Rate=4;

GrossPay=Hours*Rate;GrossPay=Hours*Rate;

System.out.println ("The Gross pay is : "+ GrossPay); System.out.println ("The Gross pay is : "+ GrossPay);

} }

}}

Page 15: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

InheritanceInheritance Now let’s talk a little about inheritanceNow let’s talk a little about inheritance

Java uses the EXTENDS keyword to declare inheritance from Java uses the EXTENDS keyword to declare inheritance from another classanother class

A java class can inherit ONLY from ONE other classA java class can inherit ONLY from ONE other class If we inherit an abstract class (meaning an interface like the If we inherit an abstract class (meaning an interface like the

ActionListener()) we use the keyword IMPLEMENTSActionListener()) we use the keyword IMPLEMENTS Overiding is implemented by just creating a method with the Overiding is implemented by just creating a method with the

same name and parameters as the inherited onesame name and parameters as the inherited one Overloading is implemented by creating a method with the same Overloading is implemented by creating a method with the same

name but different parametersname but different parameters Methods can be either friendly, default, public, private or Methods can be either friendly, default, public, private or

protected.protected. Public: can be accessed from any other classPublic: can be accessed from any other class Protected: can be accessed from any other class in the same Protected: can be accessed from any other class in the same

packagepackage Private: can be accessed only by other methods in the same classPrivate: can be accessed only by other methods in the same class

Page 16: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

class VideoTape{ String title; // name of the item int length; // number of minutes boolean avail; // is the tape in the store? // constructor public VideoTape( String title, int length ) {

this.title = title;this.length = length;avail = true;

} public void show(){

System.out.println( title + ", " + length + " min. available:" + avail ); }

}class Movie extends VideoTape{

String director; // name of the director String rating; // G, PG, R, or X // constructor public Movie( String title, int length, String director, String rating ){

super( title, length ); // use the super class's constructor this.director = director;

this.rating = rating; // initialize what's new to Movie }

}

Inheritance ExampleInheritance Example

Page 17: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

AppletsAppletsAn applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page. When you use a Java technology-enabled browser to view a page that contains an applet, the applet's code is transferred to your system and executed by the browser's Java Virtual Machine (JVM). For information and examples on how to include an applet in an HTML page, refer to this description of the <APPLET> tag.

Page 18: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

In theory, <applet has been deprecated and you should use the more generic, verbose, error-prone <OBJECT tag. <OBJECT has some minor nice features, like a standby message and a way of providing alternate implementations if the user's browser does not support Java. It can work with serialised Applets. It works for languages and plug-ins other than Java. However, <OBJECT is still not as widely supported as <applet, so it is probably wiser to stick with <applet. See the HTML spec for details.

<html><body><applet code = "testCircle.class" width="400" height="400"> </applet></body></html>

The testCircle.class is the compiled .java file.

How to place an Applet in a How to place an Applet in a WebPpage…WebPpage…

Page 19: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

An applet is an object that is used by another program, typically a An applet is an object that is used by another program, typically a Web browser. The Web browser is the application program and Web browser. The Web browser is the application program and holds the main() method. The applet part of a Web page provides holds the main() method. The applet part of a Web page provides services (methods) to the browser when the browser asks for them. services (methods) to the browser when the browser asks for them.

An applet object has many instance variables and methods. Most of An applet object has many instance variables and methods. Most of this is in the definition of Applet. To access these definitions, your this is in the definition of Applet. To access these definitions, your program should import java.applet.Applet and java.awt.*. Here is program should import java.applet.Applet and java.awt.*. Here is the code for a small applet. The name of the class is Hamlet and the the code for a small applet. The name of the class is Hamlet and the name of the source file is Hamlet.java. The definition of Applet name of the source file is Hamlet.java. The definition of Applet provides a framework for building an applet. By itself, the class provides a framework for building an applet. By itself, the class Applet does little that is visible in the Web browser. (It does a great Applet does little that is visible in the Web browser. (It does a great many things behind the scenes, however.) many things behind the scenes, however.)

To build upon this framework, you To build upon this framework, you importimport java.applet.Applet and java.applet.Applet and extendextend the Applet class: the Applet class:

When you extend a class, you are making a new class by building When you extend a class, you are making a new class by building upon a base class. This example defines a new class called Hamlet. upon a base class. This example defines a new class called Hamlet. The new class has everything in it that the class Applet has. The new class has everything in it that the class Applet has.

The class Applet has a paint() method, but that method does little. The class Applet has a paint() method, but that method does little. Objects of class Hamlet have their own paint() method because the Objects of class Hamlet have their own paint() method because the definition in Hamlet.java overrides the one in Applet. definition in Hamlet.java overrides the one in Applet.

The Web browser calls the paint() method when it needs to "paint" The Web browser calls the paint() method when it needs to "paint" the section of the monitor screen devoted to an applet. Each applet the section of the monitor screen devoted to an applet. Each applet that you write has its own paint() method. that you write has its own paint() method.

Page 20: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

A simple example…A simple example…

import java.applet.Applet;import java.applet.Applet;import java.awt.*;import java.awt.*;

public class Hamlet extends Applet{public class Hamlet extends Applet{

public void paint ( Graphics gr ) { public void paint ( Graphics gr ) { setBackground( Color.pink ); gr.drawString("To be", 25, setBackground( Color.pink ); gr.drawString("To be", 25, 30); 30);

gr.drawString("or not to be,", 25, 50);gr.drawString("or not to be,", 25, 50);

gr.drawString("That is", 25, 70 );gr.drawString("That is", 25, 70 );gr.drawString("the question." ,25, 90);gr.drawString("the question." ,25, 90);gr.drawString("--- Hamlet, W. Shakespeare" ,50, 130); gr.drawString("--- Hamlet, W. Shakespeare" ,50, 130);

}}} Result } Result

Page 21: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.
Page 22: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Now let’s see another example…Now let’s see another example…import java.applet.Applet;import java.awt.*;// Assume that the drawing area is 300 by 150.// Draw ten red circles side-by-side across the drawing area.

public class tenCircles extends Applet{

final int width = 300, height = 150;

public void paint ( Graphics gr ){gr.setColor( Color.red );int radius = (width/10)/2;// the diameter is width/10 int Y = height/2 - radius; // the top edge of the squares int count = 0 ;while ( count < 10 ){

int X = count*(width/10); /* the left edge of each of 10 squares across the area*/

gr.drawOval( X, Y, 2*radius, 2*radius ); count = count + 1; }

}} Result

Page 23: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.
Page 24: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

import java.applet.*;import java.applet.*;import java.util.*;import java.util.*;import javax.swing.*;import javax.swing.*;import java.awt.*;import java.awt.*;import java.awt.event.*;import java.awt.event.*;

public class testReflexes extends Applet implements Runnable, MouseListener{public class testReflexes extends Applet implements Runnable, MouseListener{

private JButton start;private JButton start; private JButton stop;private JButton stop; private long rightNow;private long rightNow; private boolean startPressed = false;private boolean startPressed = false;private boolean stopCanBePressed = false;private boolean stopCanBePressed = false; private int x; /private int x; /**The random value.The random value.*/ */ private long tempTime = 0;private long tempTime = 0;private Thread myThread;private Thread myThread; private double highScore = 1000;private double highScore = 1000;public void init(){public void init(){try{try{

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}catch(Exception e){}catch(Exception e){

try{try{UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());

}catch(Exception ex){}catch(Exception ex){JOptionPane.showMessageDialog(null, "Sorry, cannot recognize Operating System!", "Error", JOptionPane.showMessageDialog(null, "Sorry, cannot recognize Operating System!", "Error",

JOptionPane.ERROR_MESSAGE);JOptionPane.ERROR_MESSAGE);}}

}}setLayout(null);setLayout(null);setBackground(Color.blue);setBackground(Color.blue);start = new JButton("Start");start = new JButton("Start");stop = new JButton("Stop!");stop = new JButton("Stop!");start.setFocusable(false);start.setFocusable(false);stop.setFocusable(false);stop.setFocusable(false);start.setBounds(getSize().width / 2 - 45, 50, 90, 25);start.setBounds(getSize().width / 2 - 45, 50, 90, 25);stop.setBounds(getSize().width / 2 - 45, 150, 90, 25);stop.setBounds(getSize().width / 2 - 45, 150, 90, 25);start.addMouseListener(this);start.addMouseListener(this);stop.addMouseListener(this);stop.addMouseListener(this);add(start);add(start);add(stop);add(stop);}}

Page 25: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

public void mouseReleased(MouseEvent e){}public void mouseReleased(MouseEvent e){}

public void mousePressed(MouseEvent e){public void mousePressed(MouseEvent e){String command = ((JButton)e.getSource()).getActionCommand();String command = ((JButton)e.getSource()).getActionCommand();if(command.equals("Start")){//If start Pressed.if(command.equals("Start")){//If start Pressed.

if(!startPressed){if(!startPressed){startTime();startTime();repaint();repaint();

}else{}else{JOptionPane.showMessageDialog(null, "Hey, don't be so anxious!\n You must press 'Stop'!", JOptionPane.showMessageDialog(null, "Hey, don't be so anxious!\n You must press 'Stop'!",

"Look Out!", JOptionPane.ERROR_MESSAGE);"Look Out!", JOptionPane.ERROR_MESSAGE);repaint();repaint();

}}}}if(command.equals("Stop!")){//If stop Pressed.if(command.equals("Stop!")){//If stop Pressed.

if(startPressed){if(startPressed){if(stopCanBePressed){if(stopCanBePressed){

stopTime();stopTime();startPressed = false;startPressed = false;

}else{}else{JOptionPane.showMessageDialog(null, "Hey, DON'T CHEAT!!!", "Look Out!", JOptionPane.showMessageDialog(null, "Hey, DON'T CHEAT!!!", "Look Out!",

JOptionPane.ERROR_MESSAGE);JOptionPane.ERROR_MESSAGE);repaint();repaint();

}}}else{}else{

JOptionPane.showMessageDialog(null, "Hey, you must first press 'Start'!", "Look JOptionPane.showMessageDialog(null, "Hey, you must first press 'Start'!", "Look Out!", JOptionPane.ERROR_MESSAGE);Out!", JOptionPane.ERROR_MESSAGE);

repaint();repaint();}}

}}}}

Page 26: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

public void mouseExited(MouseEvent e){}public void mouseExited(MouseEvent e){}public void mouseEntered(MouseEvent e){}public void mouseEntered(MouseEvent e){}public void mouseClicked(MouseEvent e){}public void mouseClicked(MouseEvent e){}private void startTime(){private void startTime(){

Random rnd = new Random();Random rnd = new Random();x = (rnd.nextInt(10)+1)*1000;x = (rnd.nextInt(10)+1)*1000;rightNow = System.currentTimeMillis();rightNow = System.currentTimeMillis();myThread = new Thread(this);myThread = new Thread(this);startPressed = true;startPressed = true;myThread.start();myThread.start();

}}private void stopTime(){private void stopTime(){tempTime = System.currentTimeMillis();tempTime = System.currentTimeMillis();JOptionPane.showMessageDialog(null, "It took you " + (tempTime - rightNow) / 1000.0 + " seconds!", "Result...", JOptionPane.showMessageDialog(null, "It took you " + (tempTime - rightNow) / 1000.0 + " seconds!", "Result...", JOptionPane.INFORMATION_MESSAGE);JOptionPane.INFORMATION_MESSAGE);if((tempTime - rightNow) / 1000.0 < highScore){if((tempTime - rightNow) / 1000.0 < highScore){

JOptionPane.showMessageDialog(null, "YOU MADE A NEW HIGH SCORE!", "Congatulations!", JOptionPane.showMessageDialog(null, "YOU MADE A NEW HIGH SCORE!", "Congatulations!", JOptionPane.INFORMATION_MESSAGE);JOptionPane.INFORMATION_MESSAGE);

highScore = ((tempTime - rightNow) / 1000.0);highScore = ((tempTime - rightNow) / 1000.0);getAppletContext().showStatus("The current HighScore is " + highScore + "!");getAppletContext().showStatus("The current HighScore is " + highScore + "!");

}}setBackground(Color.blue);setBackground(Color.blue);stopCanBePressed = false;stopCanBePressed = false;

}}public void run(){public void run(){while(tempTime < (rightNow + x)){while(tempTime < (rightNow + x)){

tempTime = System.currentTimeMillis();tempTime = System.currentTimeMillis();}}

setBackground(Color.red);setBackground(Color.red);rightNow = System.currentTimeMillis();rightNow = System.currentTimeMillis();stopCanBePressed = true;stopCanBePressed = true;

}}public String getAppletInfo(){public String getAppletInfo(){ return "Title: testReflexes\n"+"Author: Lord Achilles";return "Title: testReflexes\n"+"Author: Lord Achilles";}}}}

Page 27: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

POSTing data using JavaPOSTing data using JavaURL url;URL url;URLConnection urlConn;URLConnection urlConn;DataOutputStream printout;DataOutputStream printout;DataInputStreamDataInputStream input;input;url = new URL (getCodeBase().toString() + "env.tcgi"); // URL of CGI-Bin script.url = new URL (getCodeBase().toString() + "env.tcgi"); // URL of CGI-Bin script.urlConn = url.openConnection();urlConn = url.openConnection();  // URL connection channel. // URL connection channel.urlConn.setDoInput (true);urlConn.setDoInput (true); // Let the run-time system (RTS) know that we want input.// Let the run-time system (RTS) know that we want input.urlConn.setDoOutput (true); // Let the RTS know that we want to do output.urlConn.setDoOutput (true); // Let the RTS know that we want to do output.urlConn.setUseCaches (false); // No caching, we want the real thing.urlConn.setUseCaches (false); // No caching, we want the real thing.urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); // Specify the content type.urlencoded"); // Specify the content type.printout = new DataOutputStream (urlConn.getOutputStream ());   // Send POST printout = new DataOutputStream (urlConn.getOutputStream ());   // Send POST output.output.String content =String content = "name=" + URLEncoder.encode ("Buford Early") +"&email=" + "name=" + URLEncoder.encode ("Buford Early") +"&email=" + URLEncoder.encode("[email protected]");URLEncoder.encode("[email protected]");printout.writeBytes (content);printout.writeBytes (content);printout.flush ();printout.flush ();printout.close ();printout.close ();input = new DataInputStream (urlConn.getInputStream ());input = new DataInputStream (urlConn.getInputStream ()); // Get response data.// Get response data.String str;String str;while (null != ((str = input.readLine()))){while (null != ((str = input.readLine()))){

System.out.println (str);System.out.println (str);textArea.appendText (str + "\n");textArea.appendText (str + "\n");

}}input.close (); input.close ();

Page 28: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

A Java program that runs as part of a network service, typically on an HTTP server and responds to requests from clients. The most common use for a servlet is to extend a web server by generating web content dynamically. For example, a client may need information from a database; a servlet can be written that receives the request, gets and processes the data as needed by the client and then returns the result to the client.

With the Java Web Server, servlets are placed in the servlets directory within the main JWS installation directory, and are invoked via http://host/servlet/ServletName. Note that the directory is servlets, plural, while the URL refers to servlet, singular. Since this example was placed in the hall package, it would be invoked via http://host/servlet/hall.HelloWorld. Other Web servers may have slightly different conventions on where to install servlets and how to invoke them. Most servers also let you define aliases for servlets, so that a servlet can be invoked via http://host/any-path/any-file.html. The process for doing this is completely server-specific; check your server's documentation for details.

What is a Servlet?What is a Servlet?

Page 29: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Java servlets are more efficient, easier to use, more powerful, more portable, and cheaper than traditional CGI and than many alternative CGI-like technologies. (More importantly, servlet developers get paid more than Perl programmers :-).

Efficient. With traditional CGI, a new process is started for each HTTP request. If the CGI program does a relatively fast operation, the overhead of starting the process can dominate the execution time. With servlets, the Java Virtual Machine stays up, and each request is handled by a lightweight Java thread, not a heavyweight operating system process. Similarly, in traditional CGI, if there are N simultaneous request to the same CGI program, then the code for the CGI program is loaded into memory N times. With servlets, however, there are N threads but only a single copy of the servlet class. Servlets also have more alternatives than do regular CGI programs for optimizations such as caching previous computations, keeping database connections open, and the like.

What are the Advantages of Servlets What are the Advantages of Servlets Over “Traditional CGI?”Over “Traditional CGI?”

Page 30: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Convenient. Hey, you already know Java. Why learn Perl too? Besides the convenience of being able to use a familiar language, servlets have an extensive infrastructure for automatically parsing and decoding HTML form data, reading and setting HTTP headers, handling cookies, tracking sessions, and many other such utilities.

Powerful. Java servlets let you easily do several things that are difficult or impossible with regular CGI. For one thing, servlets can talk directly to the Web server (regular CGI programs can't). This simplifies operations that need to look up images and other data stored in standard places. Servlets can also share data among each other, making useful things like database connection pools easy to implement. They can also maintain information from request to request, simplifying things like session tracking and caching of previous computations.

Portable. Servlets are written in Java and follow a well-standardized API. Consequently, servlets written for, say I-Planet Enterprise Server can run virtually unchanged on Apache, Microsoft IIS, or WebStar. Servlets are supported directly or via a plugin on almost every major Web server.

Inexpensive. There are a number of free or very inexpensive Web servers available that are good for "personaluse or low-volume Web sites. However, with the major exception of Apache, which is free, most commercial-quality Web servers are relatively expensive. Nevertheless, once you have a Web server, no matter the cost of that server, adding servlet support to it (if it doesn't come preconfigured to support servlets) is generally free or cheap.  

Page 31: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

package hall;

import java.io.*; import javax.servlet.*; import javax.servlet.http.*;

public class HelloWWW extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +

"Transitional//EN\">\n" + "<HTML>\n" + "<HEAD><TITLE>Hello WWW</TITLE></HEAD>\n" + "<BODY>\n" + "<H1>Hello WWW</H1>\n" + "</BODY></HTML>");

}}

http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-First-Servlets.html

A simple ExampleA simple Example

Page 32: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

Introduction to ProgrammingIntroduction to Programming

Some Useful Internet AddressesSome Useful Internet Addresses www.javasoft.comwww.javasoft.com www.java.sun.comwww.java.sun.com www.Javaworld.comwww.Javaworld.com

These two sites have been merged

Page 33: Java & Java Applets a brief introduction By Dereklis Leonidas for the Network Operations Center of Aristotle University of Thessalniki 18/4/2006.

That’s all folks!That’s all folks!

Good Easter and even better Lamb!Good Easter and even better Lamb!