Posts Tagged 'java'

Fibonacci Series in Java

Java code written to count and output the Fibonacci sequence.

// Algorithm for Adding Fibonacci Numbers

// @author
public class Fibonacci

public static void main(String[] args)

int count = 20; // set the number of times the equation runs ** do not exceed 44
int x = 0; int y = 1; // set the initial values to be added
int fib = 0; //  fibonacci number

for (int i = 0; i <= count; i++)
fib = x + y;
Read more →


Android Activity Lifecycle

Android Visualization Lab – University of California, Berkeley

“Like HTML webpages, Android provides functionality for setting up and tearing down. HTML provides the ability to respond to events through triggers like onLoad and onUnload. Android provides eight such methods, each to respond to a very specific situation.”
(Berkeley, University of California retrieved from: 12/22/2011)

Android API Reference

Android Package Index

Android Class Index

Android Download

Android Videos

Android Developers Guide


Image courtesy of ...

Read more →

Artificial Life – Simple Animation

One of the base things I must accomplish in the creation of a software program that emmulates the evolution and survival of life is a simplistic method of animating graphical objects. The graphics will be able to “see” and therefore will sense when they come in close contact with other objects. After a bit of research and development, I found an existing program, written in Java, that does just this.

The artificial life simulation will take into account the cycle of ...

Read more →

Artificial Life – Simple Math

The following code transforms the struggle for survival into a mathematical equation. A user is asked to enter a number of carnivores to create between 1 – 100. Once the number has been decided, the plants, herbivores and carnivores reproduce contingent on a specific ratio between plants:herbivores:carnivores or 16:6:2.

The program takes 3 separate life forms plants, herbivores and carnivores and increases or decreases their reproduction rate depedent on their ratio in comparison to the other life forms. A ratio of ...

Read more →

Artificial Life Simulation

I have many software projects that I have been working on. One of my favorites is an Artificial Life Simulation. I will be using the blog portion of to keep a running record of my work. The Artificial Life Simulation is being developed in Java.

Artificial Life Simulation Overview

Create a simulation that emulates life and evolution.
The simulation is governed by the same rules that govern our world. Graphic
objects in simulation represent life forms and environmental objects. Life
forms ...

Read more →

Duke the Java Mascot!

Duke the Java Mascot!

This is Duke, the Java Mascot. Duke and I share one thing in common, we both
love Java! To show my support for Duke and all of his Java escapades, I have
added his portrait to this site!

Duke the Java Mascot!

Would you like to learn more about the Java platform? Go to:

Would you like to learn more about Duke, the Java Mascot? Go to:

Duke ...</p><a class= Read more →


Java Exception Handling

Java Exception Handling

Moutain State University Java Study Notes
(Week 1 CIS 220 Computer Science II)

Java exception handling is based in part on Andrew Koenig's and Bjarne
Stroustrup's paper, "Exception Handling for C++ (revised).
(Reference: A. Koenig, and B. Stroustrup, "Exception Handling for C++
(revised)." Proceedings of the Usenix C++ Conference, pp. 149-176, San
Francisco, April 1990.)

Only classes that extend THROWABLE ( dirctly or indirectly
can be used with exception handling.

Error Handling Overview Psuedocode

Perform a task

If the preceeding task did ...

Read more →
Page 1 of 2 12