DOC PREVIEW
Penn CIT 591 - Using the Java API

This preview shows page 1-2-3-4-5 out of 14 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Using the Java APIWhere’s the API?OverviewGeneral approachThe Packages panelThe Classes panelThe links barThe main information areaReading the method descriptions IReading the method descriptions IIHow was this documentation produced?Value of the APIWhere to find the API docsThe EndJan 14, 2019Using the Java APIhttp://java.sun.com/javase/6/docs/api/2Where’s the API?3OverviewClassesMain Information AreaViewsPackages4General approachIf you know the name of the package, click it in the upper left panel; or click All ClassesClick on the class in the lower left panelScroll in the right pane to find the summary of the field, method, or constructor you wantOr just read the general descriptionFor more information, click the link in the summary to go to the detailed information5The Packages panelChoose the package you are interested inOr, choose All ClassesClasses in java.lang are automatically imported into every program--you don’t have to do it yourselfOld snapshots—but the format hasn’t changed6The Classes panelThis panel shows both classes and interfacesWe haven’t yet talked about interfacesNote that some classes have names similar to primitive types (Boolean, Byte, Character)7The links barOverview is where you start outIndex is handy for looking up methodsHelp is the obviousIf you don’t like frames, you can chooseNO FRAMESDeprecated methods are those that have been replaced by better methods and should not be used8The main information areaGeneral description of the classField summaryConstructor summaryMethod summaryField detailConstructor detailMethod detailIn each case, the “summary” is the first sentence of the “detail”9Reading the method descriptions IAn example from the String class:public char charAt(int index)Returns the character at the specified indexpublic means accessible from anywherechar is the return typecharAt is the name of the methodint is the type of parameter expectedindex is just a suggestive nameExample use: char firstChar = myStr.charAt(0);10Reading the method descriptions IIAnother example from the String class:public static String valueOf(int i)Returns the string representation of the int argument. public means accessible from anywherestatic means this is a class method (see use below)String is the return type, and is a hyperlinkvalueOf is the name of the methodint is the type of parameter expectedi is just a suggestive nameExample use: String numeral = String.valueOf(m / n);11How was this documentation produced?All Java documentation was produced by the javadoc program from javadoc (or just doc) comments in the source codeYour doc comments can be used in the same way to produce professional-looking documentationThe Interface menu item in BlueJ does the same basic thing as javadocLike most things in BlueJ, fancy features have been omitted in the interests of simplicity12Value of the APIVersion packages classes methods Java 1.0 8 212 1545 Java 1.1 23 504 3851 Java 1.2 60 1781 15060 Java 1.3 77 2130 17158 Java 1.4 135 2738 ? Java 1.5 and 6 ? ? ?You can only learn a small fraction of theseWhen you learn the kinds of things that are in the API, and learn to find your way around in it, you become a far more effective and efficient programmerA good craftsman knows his/her tools13Where to find the API docsOn the web:http://java.sun.com/javase/6/docs/api/On your own computer (if you downloaded them):C:/ProgramFiles/Java/jdk1.6.0_01/docs/api/index.html14The


View Full Document

Penn CIT 591 - Using the Java API

Documents in this Course
Stacks

Stacks

11 pages

Arrays

Arrays

30 pages

Arrays

Arrays

29 pages

Applets

Applets

24 pages

Style

Style

33 pages

JUnit

JUnit

23 pages

Java

Java

32 pages

Access

Access

18 pages

Methods

Methods

29 pages

Arrays

Arrays

32 pages

Methods

Methods

9 pages

Methods

Methods

29 pages

Vectors

Vectors

14 pages

Eclipse

Eclipse

23 pages

Vectors

Vectors

14 pages

Recursion

Recursion

24 pages

Animation

Animation

18 pages

Animation

Animation

18 pages

Static

Static

12 pages

Eclipse

Eclipse

23 pages

JAVA

JAVA

24 pages

Arrays

Arrays

29 pages

Animation

Animation

18 pages

Numbers

Numbers

21 pages

JUnit

JUnit

23 pages

Access

Access

18 pages

Applets

Applets

24 pages

Methods

Methods

30 pages

Buttons

Buttons

20 pages

Java

Java

31 pages

Style

Style

28 pages

Style

Style

28 pages

Load more
Download Using the Java API
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Using the Java API and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Using the Java API 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?