School of Computer Science & Information Technology G6DICP - Lecture 14 Class Libraries.

Slides:



Advertisements
Similar presentations
GUIs Part 4 CS221 – 4/17/09. Professional Assignments Assignment #2 – Download and install Visual Studio 2008 Professional Trial Software –
Advertisements

Chapter 3 - Java Programming With Supplied Classes1 Chapter 3 Java Programming With Supplied Classes.
Objectives Learn about objects and reference variables Explore how to use predefined methods in a program.
Chapter 3 Using Classes and Objects. Creating Objects A variable holds either a primitive type or a reference to an object A class name can be used as.
1 Lecture 2 Java Packages  What are Java packages?  Why do wee need packages?  How to create a Java package?  Some examples.
Java Library Java provides a huge library or collection of useful programs A gold mine of well-tested code that can save you countless hours of development.
Introduction to the JDK Java for Computational Finance
Programming in Java Unit 1.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 16: Working with Text.
CSC 142 C 1 CSC 142 Object based programming in Java [Reading: chapter 4]
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
University of Limerick1 Work with API’s. University of Limerick2 Learning OO programming u Learning a programming language can be broadly split into two.
LESSON 2 CREATING A JAVA APPLICATION JAVA PROGRAMMING Compiled By: Edwin O. Okech [Tutor, Amoud University]
Chapter 2: Objects and Primitive Data Classes and Objects String, Random, Math, NumberFormat, DecimalFormat and Wrapper Classes.
Java Packages and Libraries M Taimoor Khan
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
Week1 Using the Library (the Java API) Classes are grouped together in packages –To use a class you have to know which package it is in –Every package.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
1 The String Class Every character string is an object in Java, defined by the String class Every string literal, delimited by double quotation marks,
Objects and Classes Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary.
Static. Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved. A static method does not operate on an object double dY.
School of Computer Science & Information Technology G6DICP - Lecture 17 GUI (Graphical User Interface) Programming.
1 Programming Java Java Basics. 2 Java Program Java Application Program Application Program written in general programming language Applet Program running.
Applets Yong Choi School of Business CSU, Bakersfield.
Class Libraries Chapter 1 1 Source Intro to Java Programming Y. Daniel Liang.
Computer Science 101 Spring 2000 Section E8TBA Registration Code 1693 Dr. Christopher Vickery.
23-October-2002cse JavaIntro © 2002 University of Washington1 Intro to Java CSE 413, Autumn 2002 Programming Languages
Lecture 2 Objectives Learn about objects and reference variables.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
9.1 Java Packages A collection of classes Allows classes to be grouped arbitrarily Hierarchical structure independent of inheritance Classes can.
Introduction to Android
Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved. A class represents a single concept from the problem domain, or a.
School of Computer Science & Information Technology G6DICP - Lecture 11 Classes & Objects.
1 Basic Java Constructs and Data Types – Nuts and Bolts Looking into Specific Differences and Enhancements in Java compared to C.
Rina System development with Java Instructors: Rina Zviel-Girshin Lecture 3.
1 Java Library Lecture 9 by Dr. Norazah Yusof. 2 Java Library Java has pre-defined classes that consist of the basic language classes in Java (organized.
Modularity Computer Science 3. What is Modularity? Computer systems are organized into components called modules. The extent to which this is done is.
MCQ Which is the correct syntax for placing the string "boat" into an ArrayList name recVehicles in position 3 (index 2) for the first time? a)recVehicles.set(3,
KING SAUD UNIVERSITY – COLLAGE OF COMPUTER AND INFORMATION SCIENCES CSC 113 JAVA ONLINE DOCUMENTATION.
Objects and Classes Start on Slide 30 for day 2 Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Much of.
Packages. The main feature of OOP is its ability to support the reuse of code: –Extending the classes –Extending interfaces The features in basic form.
3-1 Creating Objects A variable holds either a primitive type or a reference to an object A class name can be used as a type to declare an object reference.
Programming in Java (COP 2250) Lecture 7 Chengyong Yang Fall, 2005.
April 20, 1998CS102-02Lecture 4-1 A Method to the Madness CS Lecture 4-1 Java's Work Horses.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana (say Doc-tor Way-oo-see-jah-nah, Doc-tor, or Bah-bah)
Know Your Java. Java is special Java source code Byte code/ native code Object code on windows Object code on Dos Object code on Lynux.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Java API Course Lecture Slides 7 June 2010 “ And you guys were putting.
CS 112 Introduction to Programming Java Graphics Yang (Richard) Yang Computer Science Department Yale University 208A Watson, Phone:
Outline Creating Objects The String Class The Random and Math Classes Formatting Output Enumerated Types Wrapper Classes Components and Containers Images.
Console Input and Output JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin, Gary Litvin,
1 Creating Objects  A variable holds either a primitive type or a reference to an object  A class name can be used as a type to declare an object reference.
Objects and Classes. F OO Programming Concepts F Creating Objects and Object Reference Variables –Differences between primitive data type and object type.
Java Import Statement Copyright © Curt Hill
Java Basics Packages.
MSIS 655 Advanced Business Applications Programming
Java Methods Objects and Classes Start on Slide 30 for day 2
Java Online documentation
Interfaces, Classes & Objects
Java Methods Objects and Classes Start on Slide 30 for day 2
Building a program (Java libraries) - an example
Object based programming in Java
Object based programming in Java
Using java libraries CGS3416 spring 2019.
Classes 5/5 May 14, 2019 ICS102: Classes 5/5.
Presentation transcript:

School of Computer Science & Information Technology G6DICP - Lecture 14 Class Libraries

2 Class libraries are pre-defined sets of classes ready for use by developers. Class libraries are pre-defined sets of classes ready for use by developers. OO programming is largely about making use of these classes. OO programming is largely about making use of these classes. The class libraries bundled with the JDK and included in each VM are called the “Core Java Classes” The class libraries bundled with the JDK and included in each VM are called the “Core Java Classes” Class libraries tend to be big - effective use of the documentation is essential. Class libraries tend to be big - effective use of the documentation is essential.

3 Packages In Java classes may be grouped into “Packages”, which have hierarchical names. In Java classes may be grouped into “Packages”, which have hierarchical names. The core class libraries are all in packages with the name java.* The core class libraries are all in packages with the name java.* For example: For example: java.lang- the main language java.lang- the main language java.util- useful widgets java.util- useful widgets java.io- i/o (disk access etc) java.io- i/o (disk access etc) java.text- sophisticated text manipulation java.text- sophisticated text manipulation java.awt- Abstract Windows Toolkit java.awt- Abstract Windows Toolkit java.awt.event- events for AWT java.awt.event- events for AWT

4 Using the Core Classes The core class library constitutes the Java API. The core class library constitutes the Java API. Class libraries tend to be big. Class libraries tend to be big. Java core classes (1.4): Java core classes (1.4): 2,723 classes in 135 packages 2,723 classes in 135 packages Typically 2-20 methods per class - very roughly 25,000 Typically 2-20 methods per class - very roughly 25,000 An understanding of the documentation is thus essential. An understanding of the documentation is thus essential

5 Example Classes Two important classes from java.lang are: Two important classes from java.lang are: java.lang.Math java.lang.Math Class variables and methods Class variables and methods The variables contain constants (  and e ) The variables contain constants (  and e ) The methods contain mathematical functions (eg Square Root) The methods contain mathematical functions (eg Square Root) Math is not usually instantiated Math is not usually instantiated java.lang.String java.lang.String Instances of String contain textual data. Instances of String contain textual data. Instance methods manipulate that data (eg comparing characters, searching and extracting information). Instance methods manipulate that data (eg comparing characters, searching and extracting information).