T2 Java programming lecture 2

T2 Java programming lecture 2 - BIOC1805Elementsof...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
BIOC1805 Elements of Bioinformatics Java programming cture 2 lecture 2 structor: Junwen John Wang Instructor: Junwen John Wang Department of Biochemistry 11 Feb 09
Background image of page 1

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

View Full DocumentRight Arrow Icon
Using the Java API http://java.sun.com/javase/6/docs/api/ pj j p 11 Feb 09
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
verview Overview 4
Background image of page 4
e Packages panel The Packages panel Choose the package you e interested in are interested in Or, choose All Classes Classes in java.lang are tomatically imported automatically imported into every program ‐‐ you on’t have to do it yourself don t have to do it yourself Old snapshots—but the format hasn’t changed 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
he Classes panel The Classes panel This panel shows both lasses and interfaces c asses ad te aces We haven’t yet talked out interfaces about interfaces Note that some classes have names similar to primitive types ( Boolean , Byte , Character ) 6
Background image of page 6
he links bar The 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 choose NO FRAMES eprecated ethods are those that have been Deprecated methods are those that have been replaced by better methods and should not be used 7
Background image of page 7

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

View Full DocumentRight Arrow Icon
e main information area The main information area eneral description of the class General description of the class Field summary Constructor summary t hd Method summary Field detail Constructor detail Method detail 8
Background image of page 8
ow was this documentation produced? How was this documentation produced? All Java documentation was produced by the javadoc program from javadoc (or just doc ) comments in the source code ur doc comments can be used in the same way Your doc comments can be used in the same way to produce professional looking documentation terface it i Bl J d th 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 simplicity 9
Background image of page 9

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

View Full DocumentRight Arrow Icon
alue of the API Value of the API i k th d Version packages classes methods Java 1.0 8 212 1545 va 1.1 3 04 851 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 ? ? ? u can only learn a small fraction of these 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 tools 10
Background image of page 10
Java IO (input/output) http://java.sun.com/javase/6/docs/api/ pj j p 11 Feb 09
Background image of page 11

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

View Full DocumentRight Arrow Icon
Background image of page 12
reams Streams All modern I/O is stream based ream is flow of data flowing in/out Stream is flow of data, flowing in/out A stream is a connection to a source of data or to a destination for data (sometimes both) n input stream may be associated with the An input stream may be associated with the keyboard or a file 13
Background image of page 13

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

View Full DocumentRight Arrow Icon
ow to do I/O How to do I/O import java.io.*; Open the stream Use the stream (read, write, or both) Close the stream 14
Background image of page 14
pening a stream Opening a stream
Background image of page 15

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

View Full DocumentRight Arrow Icon
Image of page 16
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/29/2010 for the course BIOC BIOC1805 taught by Professor Dr.brianwong during the Summer '09 term at HKU.

Page1 / 36

T2 Java programming lecture 2 - BIOC1805Elementsof...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online