Arrays and ArrayLists in Java

Arrays

Arrays are very useful to know because they are a standard that is built into C, its children languages (Java, C++, etc) and other languages such as Python. An array allows the programmer to store multiple different variables, of the same type, into a single list that can be called upon as a certain object. This, coupled with loops, makes it unnecessary for the programmer to know how many variables are being stored. It does this by allowing the programmer to create one thing (the array) instead of creating multiple different variables that would all be individually initialized and named.

Read more

Please follow and like us:

Reading User Input Using the Scanner Class in Java

Java is very versatile in its ability, but can become even more versatile with the integration of user input. One way to have user input is the Scanner Class. This class allows the programmer to scan the keyboard and get input from the user.

How to Instantiate the Scanner Class

Since it is not built into the regular Java library, it needs to be imported. It can be imported like so:

Scanner Class import

or

Screen Shot 2016-03-01 at 1.04.58 PM

Note: All imports are declared at the top of the program before the main method like so:

Screen Shot 2016-03-01 at 1.05.22 PM

Read more

Please follow and like us:

The String Class and the Integer Class

The String and Integer Classes are very useful to know. Some of their methods (runnable pieces of code) are very useful to everyday coding.

The String Class

substring(start, end) – substring can be use to grab a certain section of a string. It is used by giving it a start and end position. If no end position is given it assumes the end of the string. Also important to note, the end position is actually one more than what is grabbed. You can just use the substring right away or you can save it either over the original or in its own variable. You can see in this example:

Class Eclipse String Example

Read more

Please follow and like us:

Coding Using Variables in Java

Java is a very versatile language, that can be used for object oriented programming (OOP), computation and many other applications. In order to make full use of Java, you need to know how to use variables.

Declaring A Data Type

Declaring your data type is one of the most important things when it comes to strong information. You are essentially warning the program what type of information it should be expecting. Declaring the correct type is important because once you declare a variable as a certain data type it can not be changed. Let’s look at some examples:

Read more

Please follow and like us:

Boolean Expressions, If Statements and Loops

Boolean Expressions

 
A boolean expression is evaluated by using certain operators to come to a true or false answer. The operators are:
 
== – Returns true if the values on either side are equal
 
!= – Returns true if the values on either side are not equal
 
< – Returns true if the value on the left is less than the value on the right
 
<= – Returns true if the value on the left is less than or equal to the value on the right
 
> – Returns true if the value on the left is greater than the value on the right
 
>= – Returns true if the value on the left is greater than or equal to the value on the right
 
&& – (And) Returns true if both values are true.
 
|| – (Or) Returns true if either value is true
 

Read more

Please follow and like us:

Intro to Variables and Operators

Variables are used for storage of information in a program. They can be addressed by name and have specific types based on the information being stored.

 

Check out my other posts if you want to learn what an IDE is and how to download one or how to use Eclipse or how to use jGrasp.

 

Primitive Data Types of Variables

 

Each of the following number data types allows the user to save an integer or decimal value into variables, if it is within the range.

Read more

Please follow and like us:

Starting to Code in Java

Java is a versatile language that is great for beginners. Learning to code in Java is also fairly easy to learn how to use and has many applications. Java is an Object Oriented Programming (OOP) language. This means that by defining objects using Java we can create our own variable types. If you are new to java coding feel free to check out my other pages on what an IDE is and how to download one, how to use jGrasp, and how to use Eclipse. I will be using Eclipse to show you how to start coding.

 

Read more

Please follow and like us:

Using the Eclipse Environment

What is an IDE (Integrated Development Environment)? Which ones are good for beginners and which are good for intermediate programmers? What is Eclipse? How and where can you download it? All this and more can be found in my previous article by clicking here.

 

This is where I left off in my article Getting Started with Coding in Java:

 

 Eclipse11

Read more

Please follow and like us:

Using the jGrasp Environment

What is an IDE (Integrated Development Environment)? Which two IDEs would I suggest? What is jGrasp and how do you download and install it? You can find out in my previous article by clicking here.
This is where I left off with jGrasp in my article Getting Started with Coding in Java:

jGrasp Starting Screen

Read more

Please follow and like us:

Getting Started with Coding in Java Using IDEs

 

AICLARKE Code Academy aiclarke coding

Java is a versatile language and is taught by many as an introductory language to coding. Coding in java can be interesting and fun. It can also be simple or difficult, depending on how complicated you want to make it. This makes java a beautiful language to start coding with. Java is a user friendly language that incorporates many techniques to increase ease and functionality for the coder.

Coding in Java

One of the ways that you can start coding in Java is by using an Integrated Development Environment (IDE). This gives you an application that you can run on your computer in which you can write, compile and run your code. I am going to describe and explain the differences between two IDEs, jGrasp and Eclipse, that I would suggest using so that you can decide which better suits your needs.

Read more

Please follow and like us:
Facebook
Facebook
Google+
Google+
http://aiclarke.com/category/coding">
YouTube
LinkedIn
RSS