2,322 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Dani

The JOptionPane class is used to give the CompMortgage.java program a front-end GUI interface. The class is divided into numerous functions.

Member Avatar for diamonddog
0
181
Member Avatar for Dani

A program similar to ComputeMortgage.java utilizing a mathematical formula and multiple methods to calculate a loan payment.

1
200
Member Avatar for Dani

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.

Member Avatar for Ghost
0
232
Member Avatar for Dani

A demonstration of introductory object oriented programming. A class to define a circle object with radius, area, and perimeter parameters.

0
274
Member Avatar for Dani

This program consists of two functions in one class. It is the driver program for the CircleClass.java file.

0
196
Member Avatar for Dani

A program similar to CircleClass.java which defines a rectangle object. ClientProgram.java is the driver program for the Rectangle.java file.

0
2K
Member Avatar for Dani

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.

Member Avatar for tunstar
0
255
Member Avatar for Dani

A program combining a switch statement with static variables in a class. Based on the switch statement, a class object is dynamically created.

0
210
Member Avatar for Phaelax

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 …

0
182
Member Avatar for johnroach1985
Member Avatar for Banderson

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.

Member Avatar for alpe gulay
0
170
Member Avatar for Eddi

Hi Dani, fine Examples (the others too) to learn programming Java, but where is the MyInput.java class? Thanks Eddi

Member Avatar for cms271828
0
370
Member Avatar for Dani

This program consists of two functions in one class. It demonstrates a recursive function to calculate the factorial of a number.

Member Avatar for dharween0629
0
214
Member Avatar for Mahen

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.

0
258
Member Avatar for hivework
Member Avatar for BountyX
0
132
Member Avatar for mister-fett

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. …

0
171
Member Avatar for shouvik
Member Avatar for thakur ravi
0
117
Member Avatar for shouvik

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 …

Member Avatar for Ghost
0
254
Member Avatar for Mostafaib

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

Member Avatar for vegaseat
0
139
Member Avatar for Asif_NSU

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 …

Member Avatar for neelam_209
0
3K
Member Avatar for meabed

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 …

Member Avatar for crestaldin
0
217
Member Avatar for BlackDice

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. …

0
201

The End.