Pages

Wednesday, December 22, 2010

Session 2 - Variables and IO - JAVA Programming Guide Online

In this session, you are going to learn about variables and IO operations. This is fairly easy to understand and once you get hold of it, then whatever comes next, will be easy for you. Variables are like containers of information. However, a variable is specific container of information. For instance, if a variable has been specified to hold numbers, it will only hold numbers. Once defined, variable cannot change its type. Lets get started with this to understand in detail.
Lets design a program that adds two numbers. For this, you will have to ask one number from user, store it somewhere, ask another, store it again somewhere, add the two, and display the result. Fairly easy, isn't it? In order to do this, you will have to define three variables. The first one will hold the first number, second one will hold second number, and the third one will hold the addition of two. In order to make this simple, for now, lets not allow the user to enter decimals. This program will only allow whole numbers. For this, we have to define variables as 'integers'. When we define a variable as integer, it only allows user to type in numbers and not decimals. We can define the variables like this:

int value1;
int value2;
int sum;

Friday, December 10, 2010

Session 1 - JAVA Programming Guide Online

Today, I am going to show you how to program in JAVA. First of all, you will have to install JAVA SDK from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html

Click on JDK. This will lead you to page where you will have to select your operating system. Now, for programming in JAVA, you do not need to worry about operating systems because JAVA is a neutral language so, a program made in JAVA can be run equally on any other operating system where JAVA Virtual Machine is installed. Windows, Linux (almost all distros), and Mac OS X, all have built in JAVA Virtual Machine and so a JAVA program, built on Windows can be run on Linux as well as on Mac OS X without reprogramming or reconfiguring it.
After selecting your operating system, JAVA SDK will start downloading. Finish the setup process and now, open Netbeans.org and click on 'Download' button. This will lead you to selecting the type of NetBeans suite. You may select JAVA or you may also select 'All'. Click on 'Download' beneath it.

Ads

Look into BLOG ARCHIVE for more posts.