Tonga Institute of Higher Education

Slides:



Advertisements
Similar presentations
1 Applets Programming Enabling Application Delivery Via the Web.
Advertisements

Java Packages CSci 1130 Intro to Computer Programming with Java Instructor Tatyana Volk.
MICROCONTROLLED HOME Keith Jones EKU Deparment of Technology CEN.
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Advanced Java Class GUI – part 1. Intro to GUI GUI = Graphical User Interface -- “Gooey” Just because it’s “gooey” does not mean you may write messy code.
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
Applets, Graphical User Interfaces, and Threads / Chapter 9 1 Applets, Graphical User Interfaces, and Threads.
JAVA ENVIRONMENT JDK, API, JVM. JAVA ENVIRONMENT  Java environment includes development tools and many classes and methods. Java Environment JDK (Java.
Introduction to the JDK Java for Computational Finance
Course: Introduction to Computers
Access Control Lists Written by Bill Reed 03/11/05.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Advanced Java New York University School of Continuing and Professional Studies.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Java The Beginning. Why Java?  Currently, this is the language of the international AP course which runs Feb-Apr  FREE!  Platform-independent  Simple.
Learn about the types of Graphics that are available Develop a basic Graphics applet Develop a basic Graphics application Review the Java API and use.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
Namespaces Tonga Institute of Higher Education. Introduction to Namespaces The.Net Framework provides many classes for doing different things  File Input/Output.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
JCreator Tonga Institute of Higher Education. Programming with the command line and notepad is difficult. DOS disadvantages  User Interface (UI) is not.
Java is Awesome Sean Pierce. What is the JVM and Why do I care?
Java vs. J++ (or why J++ failed) Elisa Chong CS 151.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
Applets Yong Choi School of Business CSU, Bakersfield.
Class Libraries Chapter 1 1 Source Intro to Java Programming Y. Daniel Liang.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Java Methods Methods contain a group of instructions that together perform a single task. For example if I want to perform the task of “making a pizza”,
1 Applets are small applications that are accessed on an Internet server, transported over the internet, automatically installed and run as a part of web.
Lesson 8: The OOP concepts of Polymorphism and Interfaces.
1 Chapter 6 Programming with Objects and Classes F OO Programming Concepts F Creating Objects and Object Reference Variables –Differences between primitive.
CSI 3125, Preliminaries, page 1 Packages. CSI 3125, Preliminaries, page 2 Packages Packages are containers for classes Collection of classes Packages.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
User’s Needs/Problems Fill out form by tomorrow for your data needs. Make website for regional climate modeling library (at least references). ICTP CD.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Java API Course Lecture Slides 7 June 2010 “ And you guys were putting.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 6: The User Interface (UI) Dave.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
“Packages in Java”.
Topic: Packages Course : JAVA PROGRAMMING Paper Code: ETCS-307
A Programming Language for Web-based Computing with Graphics
Event loops 16-Jun-18.
Java Basics Packages.
Tonga Institute of Higher Education
Event loops.
Tonga Institute of Higher Education
Using the Java Library API
Event loops 17-Jan-19.
Event loops 17-Jan-19.
A Programming Language for
Tonga Institute of Higher Education
PACKAGES.
Event loops 8-Apr-19.
Building a program (Java libraries) - an example
Applet in Java.
F II 1. Background Objectives
Chapter 6 Objects and Classes
Chap 1. Getting Started Objectives
Event loops.
Add Main Topic Here Created by Educational Technology Network
Make sure you show your working out!
JAVA APPLET PREPARED BY Mr. Jahanzaib Ahmed
A Programming Language for
Event loops.
Event loops 19-Aug-19.
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Tonga Institute of Higher Education Packages Tonga Institute of Higher Education

Pre-Built Objects and Methods Method Name System.out.println("We Miss Dave!"); Package Parameter Java has many pre-built objects for us to use. Doorknob analogy We want to add a doorknob to a door. We could make our own. But it’s easier to use a pre-built doorknob. We still need to do work to add the doorknob to our door. You can find a list of pre-built objects in the Java Developer’s Kit documentation.

Java API Documentation Demonstration Java API Documentation

Organizing Classes Java comes with over 2,700 different classes for doing different things. Sun needed a way to organize the classes into groups, they decided to use packages. A package is a group of related classes.

Packages Java contains 140 different packages. These packages are arranged hierarchically (packages inside of packages). java awt event geom image lang ref reflect acl security spec

Package Names The name of the package is actually a list of names, separated by periods. java.awt.image; java awt event geom image lang ref reflect acl security spec

Using Packages If you want to use a built-in Java class, first look it up in the Java Application Interface. (API) You can find the Java API documentation on the course website page. http://www.tihe.org/courses/it151 This is the API entry for the Graphics class. The package for this class is java.awt.

Using Packages (cont.) Once you know the package for a class, import it into your program. To import all classes in a package, use the wild card (*). import java.awt.Graphics; import java.awt.*;

Case Study: Problem Michael wants to use the Socket class in his program for Networking. Which package does he need to include in his program? What is the line of code he needs to write?

Case Study: Answer Look up the Socket class in the Java API Use the import command to include the package: or import java.net.Socket; import java.net.*;

Defining a Package If you want to make your own package to be used in other programs, define it. Defining packages can lead to problems compiling your program. If you have multiple files in your project, make sure they are all defined in the same package. package myprojects.helloworld;