Java Tutorial

Arrays in Java

Submitted by GeePee on
An array is an object that holds a fixed number of values of a certain variable type. There are many uses for arrays; they allow programmers to not need to declare a new variable for each value stored. If ten numbers need to be stored (ages, weights, wages, etc.), a single array with ten components may instead be used.

Random Numbers in Java

Submitted by GeePee on
In today's tutorial, we are going to cover how to generate random numbers in Java. Random numbers are used for a wide number of applications. They can be used for random sampling, simulations, generation of keys, lotteries, and games. One of the most common uses for random numbers is in video gaming. The outcomes of many events are determined by a random number generator. One of the simplest applications of random numbers is simulating a dice roll. That is what we will simulate in this application today.

Hello World Program in Java

Submitted by GeePee on
The following is the most basic example of a Java program. You need the Java Development Kit installed in order to compile source code you write. If you don't have JDK installed on your computer, go here and click the link for your operating system for directions on how to install it. The following code contains many comments. Anything after two slashes // is ignored by the compiler. Programmers use comments to help themselves and each other keep track of what their code is meant to do.

Network Programming in Java - #8 - Chat System #3 - The Message Packet

Submitted by GeePee on
Introduction: This tutorial is the eighth in my Java Network Programming using KryoNet series, or third in creating a chat client and server system, in which we are going to be handling sending and receiving messages. Previous: In the previous tutorial we created a client handler for our server to keep track of the connected clients. The System: We are going to give the user a GUI to interact with the system - to send messages and see the currently connected members of the chat. When a client connects, add them to a list. Send incoming messa

Network Programming in Java - #9 - Chat System #4 - Client Disconnect Listener

Submitted by GeePee on
Introduction: This tutorial is the ninth in my Java Network Programming using KryoNet series, or fourth in creating a chat client and server system, in which we are going to be handling disconnected clients. Previous: In the previous tutorial we created a way to receive and send messages through a new Packet2Message class to and from our server/client. The System: We are going to give the user a GUI to interact with the system - to send messages and see the currently connected members of the chat. When a client connects, add them to a list.

Network Programming in Java - #7 - Chat System #2 - Client Handler

Submitted by GeePee on
Introduction: This tutorial is the seventh in my Java Network Programming using KryoNet series, or second in creating a chat client and server system, in which we are going to be setting up a way to handle clients on our server. Previous: In the previous tutorial we altered snippets of code to convert them from our test server and clients to our beginning point of chat server and clients. The System: We are going to give the user a GUI to interact with the system - to send messages and see the currently connected members of the chat. When a