Library Classes Flashcards
define package
a package is a collection of classes containing different built-in function
what is java.awt used for
contains classes to implement Graphical User Interface
what does the asterisk (*) sign indicate
that all the classes of the imported package can be used in a program
define primitive data types
fundamental or basic data types which are created by the system developers.
define composite data types
it is a set of primitive data types
what is Wrapper Class
a built-in data type, composite, is called wrapper class
function of Integer.parseInt()
to convert a string into integer data type
function of Integer.toString()
convert integer data type to string
need of wrapper class
- store primitive values in objects
- to convert a string to other data types, and vice versa
general syntax for converting string to primitive data types
- <primitive> variable= <wrapperclass>.parse<datatype>(String argument);
</datatype></wrapperclass></primitive> - <primitive> variable= <wrapperclass>.valueOf(String argument);
</wrapperclass></primitive>
int x= Integer.parseInt(s1)
int x= Integer.valueOf(s1)
condition for conversion from string to primitive data type
only when the string contains only numbers.
if letters are used, then java throws NumberFormatException error
general syntax for primitive data type to string
String variable== Integer.toString(int argument);
how many ASCII characters are there
256, but only 128 characters are used
ASCII for 0-9
48-57
ASCII for A-Z
65-90