1.
Java - Environment Setup
Dowload
1. [Link]
2. [Link] or [Link]
Setting Up the Path for Windows
1. Right-click on 'My Computer' and select 'Properties'.
2. Click the 'Environment variables' button under the
'Advanced' tab.
3. Alter the 'Path' variable so that it also contains the path to
the Java executable. c:\Program Files\java\jdk\bin'.
2. Java - Numbers Class
• Integer, Long, Byte, Double, Float, Short
Method
compareTo() abs()
Example equals() ceil()
• int i = 5000; valueOf() floor()
• Long l = 10l;
• float f = 13.65; toString() min()
• double d = 0xaf; parseInt() max()
Java - Strings – StringBuffer
String Methods StringBuffer
• compareTo() • append()
• concat()
• equals() • delete()
• indexOf() • insert()
• length() • replace()
• replace()
• split()
• indexOf()
• substring() • length()
• toLowerCase() • substring()
• toUpperCase()
.....
• trim()
Java - Arrays
Syntax
arrayRefVar = new dataType[arraySize];
Example
public static void main(String[] args) {
double[] myList = {1.9, 2.9, 3.4, 3.5};
// Print all the array elements
for (int i = 0; i < [Link]; i++) {
[Link](myList[i] + " ");
}
}
Method
• equals(long[] a, long[] a2)
• void fill(int[] a, int val)
• void sort(Object[] a)
Java - Date and Time
Method
after(Date date)
before(Date date)
compareTo(Date date)
equals(Object date)
getTime( ) Example
setTime(long time) import [Link];
public class DateDemo {
toString( ) public static void main(String args[]) {
// Instantiate a Date object
Date date = new Date();
// display time and date using toString()
[Link]([Link]());
}
}