Eager to Code, Enjoy to Debug ~ Embark into Each Stage with Your Heart

Archive for November 2008

Unix Shell Script – Patch Installation

Posted by: Chyne on: November 29, 2008

I still remember whenever I need to release the patches to the bank after every fix; I will follow the certain procedures to create the patch and instructions will be provided to the IT bank staff to deploy the patch to the production.
1. Create the patch

Compile the java source files into .class file.
Create an executable jar [...]

Chapter 5: Control Statements Part II (Exercise 5.24)

Posted by: Chyne on: November 15, 2008

/* Exercise 5.24
* 1. “The Twelve Days of Christmas” song.
* 2. Use repetition and switch statement to print the song.
* 3. One switch statement should be used to print the day (“first”, “second”, and so on).
* 4. A separate switch statement should be used to print the remainder of each verse.
*/
package Exercises;
public class TwelveDaysOfChristmas {
public [...]

Chapter 5: Control Statements Part II (Exercise 5.23)

Posted by: Chyne on: November 15, 2008

/* Exercise 5.23
* 1. How to remove any continue statement from a loop in a program.
* 2. Replace that statement with some structured equivalent.
* 3. Remove the continue statement from the program in 5.13.
*/
package Exercises;
public class removeContinue {
public static void main(String[] args) {
int count;
// first for loop
for (count = 1; count < 5; count++)
{
System.out.printf(“%d”, count);
} [...]

Chapter 5: Control Statements Part II (Exercise 5.22)

Posted by: Chyne on: November 15, 2008

/* Exercise 5.22
* 1. Read the odd number from the range 1 to 19 to specify the number of rows in the diamond.
* 2. Display a diamond of the appropriate size.
*/
package Exercises;
import java.util.Scanner;
public class OddDiamondShape {
public static void main(String[] args) {
// initialization phase
Scanner input = new Scanner(System.in);
int oddNum;
// ask for user input
System.out.printf(“Enter the [...]

Chapter 5: Control Statements Part II (Exercise 5.21)

Posted by: Chyne on: November 15, 2008

/* Exercise 5.21
* 1. Prints the following diamond shape.
* 2. Maximize the use of repetition (with nested for statements)
*/
package Exercises;
public class diamondShape {
public static void main(String[] args) {
int i = 10;
// upper part of diamond
for (int j = 1; j <= i / 2; j++) {
// upper part of blank spaces
for (int [...]


Friday’s Java Snack


In Java, "thread" means:

  • An instance of class java.lang.Thread
  • A thread of execution


An instance of Thread is just an object that has variables and methods, and lives and dies on the heap.
 
A thread of execution is an individual process that has its own call stack (one thread per call stack).

 

November 2008
M T W T F S S
« Oct   Dec »
 12
3456789
10111213141516
17181920212223
24252627282930

Archives


StatCounter

free hit counters