Java

Short Hand If Else Statement

Submitted by GeePee on
Introduction: This tutorial page will talk about the short hand version of an if else statement. Important: I highly recommend you read through the If Else tutorial page before reading this tutorial. How is the short hand if else statement structured? The short hand version of an if else statement is used through a couple of symbols, here is the layout of the statement; Action (setting a variable, function or method, etc.) - condition - "?" - What to do if the condition is true - ":" - What to do if the condition is false. When is a

Return Keyword

Submitted by GeePee on
Introduction: Welcome! This tutorial page will teach you about the "Return" keyword in Java. What is a 'keyword'? A keyword is a word which already has a set/pre-defined action within Java. For example; public is a keyword which allows other classes to access the public variable or function/method. So, what does the "Return" do? Return is used to send a value back from a method or function to the place where it was called. The type of value to return depends on the type of method the return keyword is encased in.

Do-While Statements

Submitted by GeePee on
Introduction: This page will teach you how to use the Do-While statements in Java. Important! It is fairly important you understand the While Statement before reading this tutorial page. It can be found on the main Java Tutorial Thread page. What is a Do-While Statement? A Do-While Statement is very similar to a While Statement, with one exception.

For Each Loops (Iteration)

Submitted by GeePee on
Introduction: Welcome, this page will teach you how to create a For Each Loop in Java. What is a For Each Loop? A For Loop is very similar to a For Loop within Java except it only requires two arguments and instead of referring to the current value of the loop through the index, we have an actual item. When are For Each Loops used? For Each Loops are used for iterating through a list of values or items and performing an action on each of them individually.

Comments

Submitted by GeePee on
Introduction: Welcome to a tutorial on the use of comments within Java. What are comments? Comments are just like the standard definition of comments anywhere in the world, they are used to explain something within the midst of the code. Comments are not read by Java and as such do not affect the program running. When are comments used? Comments are normally used to either make a note for the developer their self so they know where they need to go back to, or bookmark a specific location within a Java file.

While Statements

Submitted by GeePee on
Introduction: This page will show you how to use the While statement. What is the While statement? The While statement is used to run a block of code/script constantly until its conditions become false. When is a While statement used? A while statement is great for multi-tasking in programs, for example; while the character is moving in a game it should run a script to update the screen graphics/player co-ordinates or location. How to make a While statement: To make a While statement there are only two things you need to th

Multi-Dimensional Arrays

Submitted by GeePee on
Introduction: Welcome to the Java tutorial on Multi-Dimensional Arrays. I would highly recommend you have a look at my Arrays page before reading through this one! What is a Multi-Dimensional Array? A Multi-Dimensional Array is an array which contains more than one index at any given placement. For example; instead of just having a value at the index "3", we could have "3""0", "3""1" etc. When are Multi-Dimensional Arrays Used? Compared to arrays there are not used as often.

Arrays

Submitted by GeePee on
Introduction: Welcome, this page will teach you about Arrays within Java. What is an Array? An array is a variable which holds more than one value, in effect, it's a list of values attached to a variable name. When are Arrays Used? Arrays are very useful for holding lists of values for certain scripts. For example; holding the id of each button that has been activated within a game.