Java Programming – Integer Division and the Modulus Operator

I am continuing on with my video series on Java programming for beginners. In this video, I discuss Integer division and the modulus operator and I explain in detail how to use them, providing many examples.

In my previous video on arithmetic operators, I ended that video with an example of a division operation that resulted in an unexpected answer.  I begin this video with that very example, and explain exactly what is going on.

I also demonstrate how to determine if an integer is an even or odd number.  Lastly, I highlight the danger and common error trap of division by zero operations that beginner programmers may make.

Java Programming – Arithmetic Operators and Operator Precedence

I am continuing on with my video series on Java programming for beginners. In this video, I introduce the arithmetic operators and explain in detail how to use them, with many examples. I also discuss and illustrate the importance of operator precedence and provide a detailed example of a common error trap that beginner programmers tend to make.

The arithmetic operators are provided by the Java programming language to facilitate the familiar mathematical operations of addition, subtraction, multiplication and division.  There is also another operator called the modulus operator (represented using the percent symbol %).  The modulus operator is used to obtain the remainder when two integers are divided by each other.  For example, when 3 is divide by 2 i.e.: (3 / 2), then the reminder is 1.  That is too say, 2 divides into 3 one time with 1 over.

Java Programming – Data Types, Variables and Constants

I am continuing on with my video series on Java programming for beginners.  In this video, I introduce and explain in detail with many many examples the concepts of data types, variables and constants in the Java programming language.  I also illustrate in detail how to use the assignment operator in Java. I also provide some good software engineering tips regarding their usage as well as point out several pit-falls and errors that beginner Java programmers may make.  So, if you are learning Java and are finding it quite challenging and only have a vague understanding of data types, variables, constants and the assignment operator, well this video seeks to bring clarity to these concepts, to explain briefly the theoretical background behind them, and more importantly, illustrating practically with many examples how to use them.

I hope you find it beneficial.  If you have comments, questions or feedback, please leave a comment below.  Thank you!

Java Programming – The IF-THEN Statements

I am continuing on with my video series on Java programming for beginners.   This is a brief video to introduce the concept of the IF-THEN statement in the Java programming language and to illustrate with examples how it works. I will also provide some good software engineering tips regarding its usage as well as point out several pit-falls and errors that beginner Java programmers may make.

How to Write, Compile and Run Java programs all within Notepad++

This post provides a link to a short Youtube video tutorial that I created illustrating the steps required to configure the Notepad++ editor on Windows so as to allow you to write, compile and run a Java program all within the Notepad++ editor and consequently, not having to use the command prompt. The major benefits to be obtained is a quicker Java development lifecycle and an accelerated learning process as you progress in learning Java.

In this video I am using Windows 7 but these steps should equally work for Windows 8 and Windows 8.1  The video tutorial assumes you have already downloaded and installed the Notepad++ editor.  If you have not done so, clear instructions are provided in a previous post.  This video tutorial also assumes you have already installed the Oracle Java JDK.

The target audience of this video tutorial are those who are relatively new to Java programming and for whom the use of a professional Integrated Development Environment (or IDE for short) such as Eclipse and Netbeans is too advanced at this stage. The solution provided in this video is a happy medium between a basic text editor and a fully professional IDE.  The benefits of using Notepad++ as an IDE are outlined in an earlier post.

By the end of this video, you will be able to compile and run any Java program by simply clicking the macro menu option and selecting Compile or Run. There will be no need to open up the command prompt and manually type the javac or java commands again.

For your convenience, I am including below the commands required by the NppExec plugin (explained in the video).

c:\java\jdk180\bin\javac $(FILE_NAME)
c:\java\jdk180\bin\java $(NAME_PART)

Note: the full path to my Java installation folder is c:\java\jdk180.  You may have installed the Oracle Java JDK into a different location, hence your full pathname may be different.  Also, I have added one additional command that is not in the video – NPP_SAVE.  This command tells the NppExec plugin to save the current Java source file being edited before attempting to compile and run it.  Thus, it eliminates the requirement to save the Java source file each time you wish to compile it.

There is a deeper motivation behind this video. Briefly, in 1984 David Kolb published what is considered a ground breaking book called Experiential Learning: experience as the source of learning and development. It facilitates an accelerated learning lifecycle.  Feedback that is received sooner and more frequently allows for corrective action to be taken at an earlier stage in the learning process, and hence leads not only to better learning outcomes, but more learning outcomes in less time. Thus, it is win-win situation. This is the pedagogical reasoning underlying my motivation to make this video tutorial – to help you learn more and better in less time.  I hope it may be of assistance to you.