Tag: Java

Text Tool

Text Tool [code=’java’]/******************************************************* * MYCPLUS Sample Code – https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is...

Read More

Java Dynamic Arrays – Integers

The DynamicArrayOfInt class is a simple implementation of a dynamic array in Java. A dynamic array is a resizable array that can grow or shrink in size as needed. This class provides methods to manipulate and interact with this dynamic array of integers. In the constructor, initially the data array has a size of 1 and grows as necessary.

Read More

Moving ball applet – Java

This is a Java class that uses some trigonometry and vector mathematics in its implementation.  An object of type MovingBall holds data about a “ball” that has a color, radius, position, speed, and direction. The ball is restricted to moving around inside a rectangle in the xy-plane. The ball can draw itself in a graphics context and will move when it is told to move.

Read More