6. RGB Colour Model - some colour
values
red green blue
255 0 0 red
0 255 0 green
0 0 255 blue
0 0 0 black
100 100 100 dark gray
255 255 255 white
255 255 0 yellow
255 0 255 magenta
160 82 45 sienna
B4004A L1 6
7. Bits and bytes are sometimes called
machine code
B4004A L1 7
9. Introduction to Data Types
Here you can see data types and how many bits
are needed for each data type:
B4004A L1 9
10. Data Types
• byte - int 127
• integer – int 2^31
• short – int 32767
• long – int 2^63-1
• float – 1.754
• double – 3.1415926 (to 754 decimal
places)
• boolean – True or False, 1 or 0
• char – a (16 bit Unicode character)
• String – String s = “This is a string”
B4004A L1 10
28. Arraylist (slide 1 of 2)
ArrayList al = new ArrayList();
System.out.println("Initial size of al: " + al.size());
// add elements to the array list
al.add("C");
al.add("A");
al.add("E");
al.add("B");
al.add("D");
al.add("F");
al.add(1, "A2");
System.out.println("Size of al after additions: " + al.size());
B4004A L1 28
29. Arraylist (slide 2 of 2)
// display the array list
System.out.println("Contents of al: " + al);
// Remove elements from the array list
al.remove("F");
al.remove(2);
System.out.println("Size of al after deletions: " + al.size());
System.out.println("Contents of al: " + al);
}
}
This would produce the following result:
Initial size of al: 0
Size of al after additions: 7
Contents of al: [C, A2, A, E, B, D, F]
Size of al after deletions: 5
Contents of al: [C, A2, E, B, D]
B4004A L1 29
30. Arrays
// initialize first element
anArray[0] = 100;
// initialize second element
anArray[1] = 200;
// and so forth
anArray[2] = 300;
anArray[3] = 400;
anArray[4] = 500;
anArray[5] = 600;
B4004A L1 30
33. If ….. else if ….. else
public class Test {
public static void main(String args[]){
int x = 30;
if( x == 10 ){
System.out.print("Value of X is 10");
}else if( x == 20 ){
System.out.print("Value of X is 20");
}else if( x == 30 ){
System.out.print("Value of X is 30");
}else{
System.out.print("This is else statement");
}
}
}
B4004A L1 33
40. xml is based on a particular xml
Schema
B4004A L1 40
source www.w3schools.com/schema
41. Essential work for next week
• Please consult the OLE for details of:
– Essential readings*
– Seminar/workshop preparation work*
– Recommended further readings
– Any additional learning
* Essential readings and preparation work must always be completed in time
for the next session
41