2023BCS0199 Harsh Rajan Iyer

IT Workshop Assignment

Object

Package

It is included in the java.lang.Object package.

Constructors

Object()

Fields

Boolean, double, float

Static Methods

clone()
    Creates and returns a copy of this object.
equals(Object obj)
    Indicates whether some other object is "equal to" this one.
finalize()
    Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
getClass()
    Returns the runtime class of this Object.

Instance Methods

clone()
    Creates and returns a copy of this object.
equals(Object obj)
    Indicates whether some other object is "equal to" this one.
finalize()
    Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
getClass()
    Returns the runtime class of this Object.

ArrayList

Package

It is included in the java.util package.

Constructors

ArrayList()
    Constructs an empty list with an initial capacity of ten.

ArrayList(Collection<? extends E> c)
    Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Fields

boolean, void, integer

Static Methods

add(E e)
    Appends the specified element to the end of this list.
add(int index, E element)
    Inserts the specified element at the specified position in this list.
clear()
    Removes all of the elements from this list.
clone()
    Returns a shallow copy of this ArrayList instance.
contains(Object o)
    Returns true if this list contains the specified element.

Instance Methods

add(E e)
    Appends the specified element to the end of this list.
add(int index, E element)
    Inserts the specified element at the specified position in this list.
clear()
    Removes all of the elements from this list.
clone()
    Returns a shallow copy of this ArrayList instance.
contains(Object o)
    Returns true if this list contains the specified element.

Array

Package

It is included in the java.util package.

Constructors

NA

Fields

static

Static Methods

asList(T... a)
    Returns a fixed-size list backed by the specified array.
binarySearch(byte[] a, byte key)
    Searches the specified array of bytes for the specified value using the binary search algorithm.
copyOf(boolean[] original, int newLength)
    Copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length.

Instance Methods

asList(T... a)
    Returns a fixed-size list backed by the specified array.
binarySearch(byte[] a, byte key)
    Searches the specified array of bytes for the specified value using the binary search algorithm.
copyOf(boolean[] original, int newLength)
    Copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length.

Integer

Package

It is included in the java.lang.Number package.

Constructors

Integer(int value)
    Constructs a newly allocated Integer object that represents the specified int value.
Integer(String s)
    Constructs a newly allocated Integer object that represents the int value indicated by the String parameter.

Fields

BYTES, MAX_VALUE, MIN_VALUE, SIZE, TYPE

Static Methods

bitCount(int i)
    Returns the number of one-bits in the two's complement binary representation of the specified int value.
compare(int x, int y)
    Compares two int values numerically.
decode(String nm)
    Decodes a String into an Integer.
getInteger(String nm)
    Determines the integer value of the system property with the specified name.

Instance Methods

bitCount(int i)
    Returns the number of one-bits in the two's complement binary representation of the specified int value.
compare(int x, int y)
    Compares two int values numerically.
decode(String nm)
    Decodes a String into an Integer.
getInteger(String nm)
    Determines the integer value of the system property with the specified name.

Scanner

Package

It is included in the java.util.Scanner package.

Constructors

Scanner(File source)
    Constructs a new Scanner that produces values scanned from the specified file.
Scanner(File source, String charsetName)
    Constructs a new Scanner that produces values scanned from the specified file.
Scanner(Readable source)
    Constructs a new Scanner that produces values scanned from the specified source.

Scanner(String source)
    Constructs a new Scanner that produces values scanned from the specified string.

Fields

NA

Static Methods

close()
    Closes this scanner.
findInLine(Pattern pattern)
    Attempts to find the next occurrence of the specified pattern ignoring delimiters.
hasNext()
    Returns true if this scanner has another token in its input.
next()
    Finds and returns the next complete token from this scanner.

Instance Methods

close()
    Closes this scanner.
findInLine(Pattern pattern)
    Attempts to find the next occurrence of the specified pattern ignoring delimiters.
hasNext()
    Returns true if this scanner has another token in its input.
next()
    Finds and returns the next complete token from this scanner.

HashMap

Package

It is included in the java.util.HashMap package.

Constructors

HashMap()
    Constructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).
HashMap(int initialCapacity)
    Constructs an empty HashMap with the specified initial capacity and the default load factor (0.75).

HashMap(int initialCapacity, float loadFactor)
    Constructs an empty HashMap with the specified initial capacity and load factor.
HashMap(Map<? extends K,? extends V> m)
    Constructs a new HashMap with the same mappings as the specified Map.

Fields

NA

Static Methods

clear()
    Removes all of the mappings from this map.
clone()
    Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
containsKey(Object key)
    Returns true if this map contains a mapping for the specified key.
get(Object key)
    Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Instance Methods

clear()
    Removes all of the mappings from this map.
clone()
    Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
containsKey(Object key)
    Returns true if this map contains a mapping for the specified key.
get(Object key)
    Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Exception

Package

It is included in the java.lang.Exception package.

Constructors

Exception()
    Constructs a new exception with null as its detail message.
Exception(String message)
    Constructs a new exception with the specified detail message.
Exception(String message, Throwable cause)
    Constructs a new exception with the specified detail message and cause.

Exception(Throwable cause)
    Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Fields

NA

Static Methods

No methods Specific to java.lang.Exception, however many are inherited from java.lang.Throwable and java.lang.Object

Instance Methods

No methods Specific to java.lang.Exception, however many are inherited from java.lang.Throwable and java.lang.Object

File

Package

It is included in the java.io.File package.

Constructors

File(File parent, String child)
    Creates a new File instance from a parent abstract pathname and a child pathname string.
File(String pathname)
    Creates a new File instance by converting the given pathname string into an abstract pathname.
File(String parent, String child)
    Creates a new File instance from a parent pathname string and a child pathname string.
File(URI uri)
    Creates a new File instance by converting the given file: URI into an abstract pathname.

Fields

pathSeparator
    The system-dependent path-separator character, represented as a string for convenience
pathSeparatorChar
    The system-dependent path-separator character.
separatorChar
    The system-dependent default name-separator character.

Static Methods

createTempFile(String prefix, String suffix)
    Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its name.

createTempFile(String prefix, String suffix, File directory)
    Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name.

listRoots()
    List the available filesystem roots.    

Instance Methods

createTempFile(String prefix, String suffix)
    Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its name.

createTempFile(String prefix, String suffix, File directory)
    Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name.

listRoots()
    List the available filesystem roots.    

URL

Package

It is included in the java.net.URL package.

Constructors

URL(String spec)
    Creates a URL object from the String representation.

URL(String protocol, String host, int port, String file)
    Creates a URL object from the specified protocol, host, port number, and file.

URL(String protocol, String host, String file)
    Creates a URL from the specified protocol name, host name, and file name.

URL(URL context, String spec)
    Creates a URL by parsing the given spec within a specified context.

Fields

NA

Static Methods

setURLStreamHandlerFactor(URLStreamHandlerFactory fac)
    Sets an application's URLStreamHandlerFactory.

Instance Methods

equals(Object obj)
    Compares this URL for equality with another object.

getAuthority()
    Gets the authority part of this URL.

getContent()
    Gets the contents of this URL.

getHost()
    Gets the host name of this URL, if applicable.

getPath()
    Gets the path part of this URL.

getPort()
    Gets the port number of this URL.

Linkedlist

Package

It is included in the java.util.LinkedList package.

Constructors

LinkedList()
    Constructs an empty list.

LinkedList(Collection<? extends E> c)
    Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Fields

modCount

Static Methods

add(E e)
    Appends the specified element to the end of this list.

add(int index, E element)
    Inserts the specified element at the specified position in this list.

addFirst(E e)
    Inserts the specified element at the beginning of this list.

addLast(E e)
    Appends the specified element to the end of this list.

clear()
    Removes all of the elements from this list.

Instance Methods

add(E e)
    Appends the specified element to the end of this list.

add(int index, E element)
    Inserts the specified element at the specified position in this list.

addFirst(E e)
    Inserts the specified element at the beginning of this list.

addLast(E e)
    Appends the specified element to the end of this list.

clear()
    Removes all of the elements from this list.

2023BCS0199 Harsh Rajan Iyer