2,322 Reusable Code Snippet Topics
Remove Filter ![]() | |
The JOptionPane class is used to give the CompMortgage.java program a front-end GUI interface. The class is divided into numerous functions. | |
A program similar to ComputeMortgage.java utilizing a mathematical formula and multiple methods to calculate a loan payment. | |
A single class consisting of multiple methods is used to demonstrate the robustness of keyboard input in Java. A try-catch block is used. The program graphically prints out a square root table by using JTextArea, JScrollPane and JOptionPane. | |
A demonstration of introductory object oriented programming. A class to define a circle object with radius, area, and perimeter parameters. | |
This program consists of two functions in one class. It is the driver program for the CircleClass.java file. | |
A program similar to CircleClass.java which defines a rectangle object. ClientProgram.java is the driver program for the Rectangle.java file. | |
Two classes which aim to demonstrate private and public members of a class. A static variable is used as an accumulator to keep track of the number of class objects which are created. | |
A program combining a switch statement with static variables in a class. Based on the switch statement, a class object is dynamically created. | |
Nothing fancy, but I know many new programmers are often confused about recursion. Recursion simply is when a method calls itself. What MyTree does is it adds nodes to the root node, then that root node can be used to create a JTree. The populate() method reads in a list … | |
| |
Here is a code to sort numbers instead of strings using the BubbleSort method. The difference here is you don't use compareTo() for numbers as you do with strings. | |
Hi Dani, fine Examples (the others too) to learn programming Java, but where is the MyInput.java class? Thanks Eddi | |
This program consists of two functions in one class. It demonstrates a recursive function to calculate the factorial of a number. | |
Hi everyone, I've been working on this calculator for days, and now i am making it opensource so that everyone can bring his own contribution, please comment all your codes very well. | |
This tiny code will demonstrate how to log-off from windows. Enjoy! | |
I just spent about an hour making this story builder to create book and short story outlines. It is written in C. If anyone has suggestions, please reply to this, PM or email me. Anyway, here is the code and .cpp, as well as the exe in a zip file. … | |
| |
Well I thought u might be bored with the hangman stuff i posted a few days ago so here is a new gaming programme. well in this one all u have to do is try to guess the number correctly while running the programme. suggestions are welcome. this is not … | |
hi this is a program for simulation the scheduling in processes between RAM and CPU the program in c language and i hope that you will engoy it and i will be ready for more help | |
It's a game where u shoot from a cannon and the cannon-ball moves like a projectile and hits a target. So u will see three major things in this program: 1. Rotating a cannon; 2. How to move an object like a projectile 3. A very simple collision detection Before … | |
hi all .. this is intorduction to an anonymous classes, An anonymous class is one that doesn't have a name. In the following example, both structures inside the TRectangle union are anonymous classes: Here is an example of running the program: You want to identify your rectangle by its location … | |
I don't know if this function may be helpful to anyone, but I just converted from a VB function recently to C++. I'm converting a text file string that is nine characters to a decimal value that has funny characters in it because it is exported from an old VAX. … |
The End.