java - Intro to Java for ECS 160 Stoney Jackson...

Info icon This preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Intro to Java for ECS 160 Stoney Jackson [email protected] wwwcsif.cs.ucdavis.edu/~jacksoni What’s the first question you’ve got to ask  about a language named Java?
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
    2 Can you make coffee with it?
Image of page 2
    3 It was meant to!! A programming language for appliances!
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
    4 Java Virtual Machine Must Run on Any Architecture Program in Java Java Compiler Java Bytecode Java Virtual Machine “WRITE ONCE, RUN ANYWHERE!” debug pretty portable
Image of page 4
    5 Doesn’t Make Coffee Yet
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
    6 So What’s Java Good For? Web applications! Java Applet Server Java Applet
Image of page 6
    7 Java on the Web: Java Applets Clients download applets via Web browser Browser runs applet in a Java Virtual Machine (JVM) Interactive web, security, and client consistency Slow to download, inconsistent VMs  (besides, flash  won this war) Applet Client Server
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
    8 Java on the Web: J2EE Thin clients (minimize download) Java all “server side” THIS IS WHAT YOU’LL BE DOING!! Client Server JSPs Servlets EJB JDBC
Image of page 8
    9 The Java programming environment Compared to C++:  no header files, macros, pointers and references, unions, operator  overloading, templates, etc. Object-orientation : Classes + Inheritance Distributed : RMI, Servlet, Distributed object programming. Robust : Strong typing + no pointer + garbage collection  Secure : Type-safety + access control  Architecture neutral : architecture neutral representation Portable Interpreted High performance through   Just in time compilation + runtime  modification of code Multi-threaded
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
    10 Java Features Well defined primitive data types: int, float, double, char, etc. int 4 bytes [–2,147,648, 2,147,483,647] Control statements similar to C++: if-then-else, switch, while, for  Interfaces Exceptions Concurrency Packages Name spaces Reflection Applet model
Image of page 10
    11 The Java programming environment  Java programming language specification Syntax of Java programs Defines different constructs and their semantics Java byte code : Intermediate representation for Java programs Java compiler : Transform Java programs into Java byte code Java interpreter : Read programs written in Java byte code and  execute them Java virtual machine : Runtime system that provides various  services to running programs Java programming environment : Set of libraries that provide  services such as GUI, data structures,etc. Java enabled browsers : Browsers that include a JVM + ability to  load programs from remote hosts
Image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
    12 Java: A tiny intro How are Java programs written?
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern