1 / 6

CIS3023: Programming Fundamentals for CIS Majors II Summer 2010

CIS3023: Programming Fundamentals for CIS Majors II Summer 2010. Java API. “ And you guys were putting Java in light bulbs and everything else. ” --Steve Jobs.

urania
Download Presentation

CIS3023: Programming Fundamentals for CIS Majors II Summer 2010

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Java API “ And you guys were putting Java in light bulbs and everything else. ” --Steve Jobs Course Lecture Slides7 June 2010 Ganesh Viswanathan

  2. Java Library • Oracle (earlier Sun) ships hundreds of pre-built classes • This set of classes is called the Java library or the Java API

  3. Packages • Classes are grouped into packages • Packages are hierarchical • you can have packages within packages. • Example • java.lang.Math indicates that Math is a class in the package lang and that lang is a package in the package java.

  4. Some Java Packages

  5. Using a class from Java API • Find out which package the class is in • Put an import statement at the top of your source code file • Example: import java.util.Arrays; import java.util.*; • Now you can use the class and its methods • If you do not have the import statement, you can still use the class, but every time you will have to qualify the class name with the package information. • For example, java.util.Arrays.sort(…)

  6. Knowing about Java API • How do you know what classes are there in Java API or methods are there in a class in Java API • Go to : • Click on the package name and then the class name to know about what that class can do for you http://java.sun.com/javase/6/docs/api/index.html

More Related