Wednesday, 26 June 2013

IGNOU MCA EBOOKS

IGNOU MCA students can download the course material in the form of ebooks. Here I am presenting the study material in the form of pdf books. It includes all the semester subjects. The material is simply the ebook version of the material given to the IGNOU students when enrolling for the MCA course.

Below books are meant only for IGNOU MCA registered students. If you are not a IGNOU student, then please don't download ebooks from here.


  1. MCS-011 Problem Solving and Programming
  2. MCS-012 Computer Organization and Assembly language Programming
  3. MCS-013 Discrete Mathematics
  4. MCS-014 Systems Analysis and Design
  5. MCS-015 Communication Skills
  6. MCSL-016 Internet Concepts and Web Design
  7. MCSL-017 C and Assembly Language Programming Lab
  8. MCS-021 Data and File Structures
  9. MCS-022 Operating System Concepts and Networking Management
  10. MCS-023 Introduction to Database Management Systems
  11. MCS-024 Object Oriented Technologies and Java Programming
  12. MCSL-025 Lab (based on MCS-021, 022, 023 & 024)
  13. MCS-031 Design and Analysis of Algorithms
  14. MCS-032 Object Oriented Analysis and Design
  15. MCS-033 Advanced Discrete Mathematics
  16. MCS-034 Software Engineering
  17. MCS-035 Accountancy and Financial Management
  18. MCSL-036 Lab(based on MCS-032, 034 and 035)
  19. MCS-041 Operating Systems
  20. MCS-042 Data Communication and Computer Networks
  21. MCS-043 Advanced Database Management Systems
  22. MCS-044 Mini Project
  23. MCSL-045 Lab(UNIX & Oracle)
  24. MCS-051 Advanced Internet Technologies
  25. MCS-052 Principles of Management and Information Sytems
  26. MCS-053 Computer Graphics and Multimedia
  27. MCSL-054 Lab( based on MCS-051 & 053)
  28. MCSE-003 Artificial Intelligence and Knowledge Management
  29. MCSE-004 Numerical and Statistical Computing
  30. MCSE-011 Parallel Computing

Live Like Today is Your Last Day!

This post is all about my personal thoughts. But do consider reading this post because it teaches so many things related to life which we generally use to ignore. Have time? Then continue reading.

Are we really enjoying life? Let us see a small glimpse what is happening in our life. At first in school days, we are dying to finish our high school and start college. And then we are dying to finish college and start working. Then we are dying to marriage and have children.Then we are dying to retire. We think at this age we will enjoy life. But what is the guarantee that we will be alive up to this stage? And then when we are dying, suddenly we may realize 'I forgot to live'. Please don't let this happen to you. Enjoy each and every moment in your life.

Actually we are making thorough preparations for rainy season such that we are forgetting to enjoy today's sun shine.

Why we give so much importance to make money? To make money we lose our health and then to restore our health we lose our money. We live as if we are never going to die, and we die as if we never lived! So my dear friends appreciate your current situation and enjoy each day!

Here is a little sharayi taken from the movie "Zindagi Na Milegi Dobara" written by Javed Akhtar. If you know Hindi you will really enjoy the meaning of it.


Dilon mein tum apni Betaabiyan leke chal rahe ho
Toh zinda ho tum
Nazar mein khwabon ki Bijliyan leke chal rahe ho
Toh zinda ho tum
Hawa ke jhokon ke jaise Aazad rehno sikho
Tum ek dariya ke jaise Lehron mein behna sikho
Har ek lamhe se tum milo Khole apni bhaayein
Har ek pal ek naya samha Dekhen yeh nigahaein
Jo apni aankhon mein Hairaniyan leke chal rahe ho
Toh zinda ho tum
Dilon mein tum apni Betaabiyan leke chal rahe ho
Toh zinda ho tum

Dance like nobody is watching.
Sing like nobody is listening.
Love like you've never been hurt.
Work like you don't need the money.
Live like it's heaven on earth.

Let me know your thoughts regarding your life by commenting below!  

Introduction to Java

Welcome to our first session of Java Tutorial. This is for those people who are absolutely new to programming. Hope you will like our first session.


Before starting our session let us introduce myself. Of course you know pretty well who I am. But still people who are new to my site can visit About Me page for further details regarding me. I am too interested to know about who you are! So let me know your details by dropping a comment below.

I am a strong lover of C language. But I like Java too. I am programming in Java for the past 6 years. In this mean time I got so many situations where I felt that Java is the perfect language to solve a particular problem. I also experienced some situations where Java was little helpful and I have to shift to my lover C :).

Since this is a online tutorial I just want to confirm whether you are reading each and every word correctly or not. I mean whether you are in hurry or not. Generally people who are addicted to learn via listening will find this tutorial a little bit confusing. But trust me I will make it easy and fun.

This is for just for test. Read the quotation given below only once and identify how many times the letter F is repeated. Remember you have to count the F's by reading the quotation only once.


"FINISHED FILES ARE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF MANY YEARS"

Now let me know your answer. Anybody got the count 6? I think many of you have ignored the F present in OF. So what is your count?

The above test is just an alert for you to observe each and every word written by me. Actually I may have directly jumped to starting lesson like features of Java, data types and so on. But then there is no difference between books and me. I just want to make sure that you should enjoy programming and don't by heart each and every statement.

Always remember that Programming is nothing but understanding yourself! The more and more you are programming the more and more you are understanding yourself.

Many people try to introduce Java by blaming C and C++. I don't know why this trend is followed by all. For me C is created for separate purpose, C++ is created to solve different problems and Java is created to solve some other critical problems. Actually none of them are interrelated. You can compare the syntax's but you cannot compare and say that Java is a great programming language and C is useless. Still there are plenty of openings in C are there and Java cannot be used in replacement to C.

OK. That's enough of comparing! I have to say lot of things but unable to express all my thoughts via this post because I am new to typing. Please ignore my grammar mistakes but try to highlight my programming mistakes in a program :).

So in order to program in Java basically we need Java software. If it already exists in your system then no problem! But if it is not present then I recommend you to have it via your friends or you can download it free of cost from the official site link Java Download. At the time of writing this post in the official site JDK 7 update 2 is available. By clicking the link a page will be opened and you will find JAVA SE Downloads. Select the first icon. Now you have to accept the license agreement in order to download Java.

Generally we are having two types of systems (OS). 32 bit OS or 64 bit OS. Maximum all the operating systems we are using comes under 32 bit category only. So I recommend you to download 32 bit version Java software. If you are sure that your Operating System is 64 bit OS then go for 64 bit version Java software.

In order to download 32 Bit OS compatible software just click on the link that says Windows x86. Don't worry you are downloading the right version only. 32 bit is not referred as x32 :). It is widely recognized as x86 due to Intel 8086 processor version naming convention.

If you are using Linux operating system then go for either Linus x86 or Linux x64 depending upon your OS.

For Windows OS the Java file size is around 84 MB and it is named as jdk-7u2-windows-i586.exe. If the net connection is slow it will take time. Hence I had provided the download link in the starting session itself so that from the second session onwards you don't need to mess up with all these things. Hope the downloading procedure is clear to you now.

I have already installed JAVA SE 6 or 5 present in my system. Shall I have to download Java SE 7?
If you have already installed or the old version of Java is already there in your system then also I recommend you to download the newest version of Java SE 7 because I am going to cover some features which will not work in older Java versions. Of course I will inform about those features when the time comes.

In order to type your program you need some interface also. The advanced interfaces generally referred as IDE's (Integrated Development Environment). The world famous IDE's for Java are Eclipse and NetBeans. But at this stage I don't recommend you to download Eclipse or NetBeans because as a beginner you will be confused regarding how to use them. And these are actually not necessary also.

You can go for simple file editors like EditPlus or Notepad++ . Even these editors are not necessary at all.

The best way to start programming in Java is via Notepad present in Windows XP or Windows 7 or via vi editor present in Linux. These two editors are built in and you don't need to download any thing at all :). Pretty cool!

If Eclipse, NetBeans, Editplus or Notepad++ are not necessary why are you providing this info?
In order to answer this question I have to mention one incident that I personally experienced. One of my friend attended training session on Java in a famous institute and the institute told that they offer world class training on Java via Eclipse software. They said industry uses Eclipse and not notepad. If you are programming in notepad then it means you don't know any thing at all. They said as a beginner you should go for Eclipse so that you can enter into software industry quickly.

The answer given by that training institute is just a trash. As a beginner if you go for Eclipse you may get comfort in typing but actually the core of language is get hidden and you may not answer even a simple question on how to execute a Java program. So my dear friends believe me you don't need to download any thing except JAVA SE 7.

At present Java software is mainly available in three flavors. They are Java SE (Java Platform Standard Edition), Java EE (Java Platform Enterprise Edition) and Java ME (Java Platform Micro Edition). Previously they used to be known as J2SE, J2EE and J2ME. Java SE is mainly used to develop desktop applications and it is the core of Java. We are going to deal with this only and the link is already provided to download above. Java EE is used to develop server applications and hence in order to learn this you need strong foundation in Java SE. Java ME is mainly used in embedded devices like mobile phones. All the three technologies are widely popular. Of course Java ME is somewhat loosing it popularity because Android (Google product) applications are growing in the market. But still having strong foundation in Java SE will help you to learn Java ME and Android easily.

Java is having one more flavor known as JavaFX. This is still not popular. But we cannot predict its future right now.

Our discussion is only on Java SE i.e. on Standard Edition. Some used to call it as Core Java also. It consists JRE (Java Runtime Environment), JDK(Java Development Kit), JVM (Java Virtual Machine) and many more tools. Don't worry we will see all these one by one. Just be familiar with the names!


Java SE Version History, Code Names and Release dates:

















Java VersionCode NameRelease Date
JDK 1.0OakJanuary 1996
J2SE 1.2PlaygroundDecember1998
J2SE 1.3KestrelMay 2000
J2SE 1.4MerlinFebruary 2002
J2SE 5.0TigerSeptember 2004
Java SE 6.0MustangDecember 2006
Java SE 7.0DolphinJuly 2011

The above table shows the major releases of Java as well as their code names. Please do remember the code names because in some technical interviews they just used to ask you what are the extra features available in Tiger as compared to Merlin? Tiger is just a nick name of J2SE 5.0 then only you can understand what actually the question means. One of my friend just answered that he doesn't know Tiger language :).

If Java is successfully installed on your system then open command prompt (Just press Window Key+R Key simultaneously and in the dialog box type cmd) and type the following command Java -version

D:\N>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

If you get the above output then it means Java SE 7 was successfully installed on your System.

At this moment the time is sharp 1 AM and I am going to schedule this post for morning 9 AM. Sorry friends I was unable to start Hello World program because there are so many things I want to cover before our starting program. Hope you enjoyed the session.

Let me know your valuable views and suggestions by replying via comments!  

Java Tutorial For Beginners

Hi friend! Are you interested to learn Java programming online? Then this is the perfect place to learn it easily and quickly. Those who are not related to programming please kindly skip this post.

Actually I planned to introduce a step by step tutorial on Java at the beginning of this year itself but unfortunately the idea got postponed due to my freelancing projects as well as due to personal problems :cry: and finally I got time to introduce this tutorial at the end of the year :).

Before going to start the tutorial let us discuss who should learn Java? If you want to learn Java programming I strongly recommend you to have programming skills in C language. And it may be much better if you know a bit of C++ also. But don't think that if you don't know C you cannot learn Java!. It's possible to jump directly to Java but you cannot enjoy the way a C programmer is going to catch the concept. Hope you understand my point.

And finally regarding this tutorial this is purely for beginners. I am planning to write at least thirty articles on Java. If this is not sufficient I will expand it up to 45. People who are well versed with Java can also go through this tutorial because I am not going to cover the concept in a way you are going to find in books. Everybody will have a different view on the language. So my view may be a bit different and I hope you may like this!

I was much inspired by a quotation given by creator of perl language Larry Wall. He says:

"A language is not worth knowing unless it teaches you to think differently."

So I will always try to present the concept by keeping the above quote in mind. Each day a new post will be posted at morning 9 AM. I will try to be online at this time so that if you have any queries regarding the concept you can clarify them instantly. Anyway you can also post your comments at a later time and I will provide the solution with in 24 hours.

All the links will be available in this post so that you can refer to the tutorial from one place easily. So my dear friend try to attend for tomorrow session online at sharp 9 AM :).

One more thing! while posting comments do address me simply Naresh or Naresh Bharat. No need to call as Sir. I actually feel a lot inconvenient when somebody refer me as sir. Because I believe that a teacher is a life long student and a student is a life long learner. I too expect to receive some thing new from you. Hope you don't disappoint me!

This Java session is dedicated to my teacher Prasanna with out whom I can simply say that I may not be related with computer field. Prasanna used to teach C language to me at my degree level. Inspired by Prasanna I learned Java on my own.

Tutorial 1: Introduction to Java

Tutorial 2: History of Java

Tutorial 3: Features Of Java

Tutorial 4: Java Basics

Tutorial 5: First Java Program Execution

Tutorial 6: Java Naming Conventions

Tutorial 7: Keywords in Java

Tutorial 8: Basic Data Types in Java

Tutorial 9: Operators in Java

Tutorial 10: Control Flow Statements in Java

Due to some personal problems I was unable to present the tutorial daily. Inconvenience caused is deeply regretted. 

Features Of Java

Hai friend! Welcome to our tutorial. Today we are going to discuss the features of Java and try to find why Java became popular.

Let us start with a real world scenario. Suppose a company decided to hire a candidate for an opening. It has offices at different locations in the world. Also imagine that Naresh is going to apply for this position. One more point here is even the company has worldwide locations I am interested to apply for Bangalore India only. I mean other than this location I am not interested to work any where. I am location dependent. Is the company going to prefer me? Not at all.

Generally companies going to prefer the candidates who are able to relocate anywhere in the universe :). The people who are willing to work at any location can be termed as location independent. Means they does not depend on location.

Like the same way imagine if you have written a program on one system say Windows XP operating system. If the same program is not going to work on other operating system like Linux OS we can say that the program is system dependent or platform dependent. Less people prefer these programs because in future there may be a chance of changing the system and the program simply becomes useless.

Java is Platform Independent. You already know what this means!

In real world there is no data and no logic. Imagine that every one is an object. Let us say that Naresh is also an object. I have some attributes like height, weight and color. I also exhibit functionalities like walking, talking, swimming and blogging :) etc.

If any problem is going to be solved by this type of thinking you can say that it is an object oriented program. Of course there are a lot of features to be supported by a program in order to term it as an object oriented programming example.

Java supports Object Oriented Programming. I will try to cover these features later.

Let us consider one more feature of Java. Java is secure.

Suppose if you want to meet a top minister to discuss some personal things.

Generally VIP's enjoy high security. So in order to meet them you have to first approach a high command person who actually used to transfer the message to that person. That means between you and the VIP there exists another person who used to interact with VIP and you. But why is this mediator? You know pretty well to protect the minister.

Like the same way Java provides one type of sandbox effect where you are going to interact with the system via JVM. That means you are not going to directly access the system. It is via JVM sandbox. This way Java became secured.

Let us discuss one more feature. Suppose I told you to add two numbers. Then you should get those two values so that addition can be performed on those numbers. But I have given values as n and b. Can you add two letters? No. So immediately you should say that please give a number and not letter. This time I given a number 9. Is it sufficient to perform addition on single number? No. Again you will say that please give me two numbers. This is the way a computer should be programmed. Never expect user will input as per your thinking. We cannot predict a user mind. Your program should handle all type of inputs and should provide appropriate action based upon the particular mistake. These type of features makes a language error free. Also referred as robust.

Java is robust.

Java supports many more features like multithreading, automatic memory management, distributed programming and so on.

I will expand this post later. 

History Of Java

Hi friends Good Morning! Welcome to our second session. Today I am going to discuss history of Java instead of going for Java program directly. Because I think you should know a little bit history before starting our first Java program.


In general James Gosling is referred as father of Java programming language. Let us have a small flash back.

Initially in 1990's Patrick Naughton is working on Sun's project named Stealth Project. Later this Stealth Project was renamed to Green Project when James Gosling and Mike Sheridan joined this project. Later Bill Joy also joined this. You can say that James Gosling is the team leader for this project. Actually these people initial goal is to built embedded software for consumer electronic goods like set top boxes and cable TV. Later they shifted their focus on world wide web, and this became the turning point.

The team called this developed language as Oak (There are stories on internet that Oak is the tree the team used to see via window). But since the name is already registered by some company they want to change to different one. Then the team came up with alternate names like Java, DNA, WebRunner and Silk. From these names at last Java was chosen.(It means coffee. The team used to drink a lot of coffee and fine quality coffee is imported from Java island, Indonesia. That's why the language name kept to Java!). US people general slang for coffee is Java.

By this way first version of Java came in the year 1995 by Sun Microsystems. The name Sun stands for Stanford University Network. Even though Java was created by James Gosling, the company Sun Microsystems was founded by Vinod Khosla (an Indian). This is really a great feeling for every Indian.

This is not the only case. For every revolutionary product or idea behind the scenes there will be an Indian. Yes I have so many examples to prove this point. When the time comes I will present them.

But later on Oracle purchased Sun Microsystems and Java became the product of Oracle Corporation. This may be a sad news, but no problem! Java future is safe under Oracle.

So what about James Gosling? Where is he now?
Don't worry! He is alive :). James Gosling worked with Oracle for some time and then he joined Google Company. But sadly he doesn't worked in Google also for long time and later he joined Liquid Robotics.

I provided all these updates time to time to my regular visitors the moment it happened. At present he is associated with Liquid Robotics. Are you interested to visit James Gosling blog then it is at www.nighthacks.com. I am a regular visitor of his blog!

Sorry for a short post. Scheduling this post for tomorrow morning 9 AM. Hope you will enjoy this!

Liked today's session? If not then I want to share one more thing. James Gosling had two daughters, named Kate and Kelsey :). 

First Java Program Execution

Before going to run our first Java program we need some settings on our computer to execute our program. Let us see them.


In Windows XP or 7 we need path setting in onrder to execute our Java program. I all ready provided the download link to download Java software.

If you have download JDK1.7 update 2 then in your system you get one folder like this. I am assuming that Java is installed in C drive.

"C:\Program Files\Java\jdk1.7.0_02\bin" This folder contains Java compiler and Java interpretor which are necessary to compile and run our program. Hence these tools are necessary to be in our Windows PATH so that we can use them. To do this we need to include the above directory in our Windows Path so that OS can recognize our commands.

Just copy the above path with out quotes and include it in the path by following the steps below.

Right Click on My Computer Icon present on the desktop and choose properties. Click on Advanced tab and in this tab click on Environment Variables. You will find two types of panes User Varaibles and System Variables. Under System variables search for the variable named PATH. Now click on Edit. If it is not there click on New Button to create it.

If the PATH already exists then the current path is shown in varaiable value. Don't delete the existing value. Just add our JDK path to the existing path. To do this just add ; at the end of current path and paste the above path. Just press OK. Be careful will editing these settings. It will look like this.

Variable Name: Path
Variable value: .......; C:\Program Files\Java\jdk1.7.0_02\bin

How to verify PATH setting is successful or not?
Just open command prompt and type javac and press enter. If it says javac is not recognized as an internal or external command then it means there is something wrong with your path settings.

If the PATH setting is correct you will get its usage syntax and a list of options supported by the command.

This is all regarding the PATH setting.

Since we are going to execute a lot of programs let us make one personal directory where all our Java related programs can be stored. Assume that in my system I am going to store all my programs under D:\Naresh>.

Goto start and open Run or just press the shortcut Window Key + R. Type cmd and you will taken to command prompt. By default it points to current directory. Just shift to D drive by typing D: and create one directory named Naresh (give any name of your choice) by the command md naresh then move to my directory Naresh by change directory command cd Naresh. Now the path appears like above D:\Naresh>.

Now let us start our first Java program. Create a file named First.java where we are going to write our source code. Here is the shortest way to do this!

D:\>Naresh>notepad First.java

The above command will open a Notpad window and it will ask Whether you want to create a file named First.java . Just press yes. If the file already exists it will just open the file with out displaying any dailog box. Now type the following code in this file.


/*  

First Java program by Naresh Bharat.
Visit www.nareshbharat.com for free Java Classes Online.

*/

import java.lang.*;
class First
{

public static void main(String args[])
{
System.out.println("Hello World!");
}

}

After typing the code just save the program by pressing Control and S key simultaneously. Otherwise Click on Close button and it will ask whether you want to save the changes. Press yes and you are done!

To compile the Java program we need java compiler. This can be done with the help of javac command. Just type the following command at prompt.

D:\Naresh>javac First.java

If you get the prompt immediately after giving the above command like below

D:\Naresh>

This means you successfully compiled your Java program. If there is any error then error will be displayed. If it contains any error again open Notepad window edit your program and come back to the command prompt and once again try to compile the program. Repeat this procedure until your program is error free.

If every thinng is OK, you will get First.class file in your current directory. This is the byte code. Just for confirmation type dir command and verify the files list. You will find that java compiler has created one .class file related to your program

Now to run our Java program we need Java Interpretor. For this use the following command.

D:\Naresh>java First
Hello World!


Just type the class name i.e. First. Don't give .java or .class extension here. The command java just takes class name with out extension.

If you get the above result that means you are successful in executing our first program. Every Java program execution is like this only.


Actually I just exectued the program with out explaining any thing about what really the purpose of every line written. Let us discuss in more detail.

/* */ This is know as comment section. Every thing written inside /* and */ is just for our understanding. Java compiler just ignores all the content present inside comments. You can assume it just like you write the date in your notebook so that it can be referred later easily. You write date in your notebook just for your sake. The content in your notebook is not related to date at all. Like the same way comments are just for our understanding. Do remember that comments can be defined any where in a Java program.

If the comment contains a single line Java provided one more style as a shortcut. Just type // and write your comment. Any thing written after // will be ignored by compiler. But your comment should not conatin more than one line.

Java even provided one more comment style known as documentation comment. It starts with /** and ends with */. I will discuss this later when the need occurs.


The import statement is used to import the packages in our program. Here I am include java.lang package into my program. By default even if you don't write this, the packace is imported automatically. Just for knowledge sake I mentioned it.

Every language will have set of rules to be followed while programming. Java states that every thing should be written inside a class. And the calss syntax is very simple!

class
{

}

Note that here class is a keyword used to tell the compiler that class declaration is to be defined. The content in the class is to be included with in { }.

Every standalone Java program execution starts from main method. Unfortunately main method syntax in Java is somehow lengthy as compared with the syntax of C.

I will try to explain what is the purpose of every word. Don't worry even though if you are not getting into this concept. As a starter it is difficult to understand perfectly the meaning of every keyword. Gradually when the specific concept comes you will get better idea.

public keyword is used to access the main method by outside world.

static keyword is used to access main method directly with out creating object. This is enough just for now. Later you will come to know what is meant by object creation and all the things related to it.

void is used to indicate that main method is not going to return any value. If any method does not return any value then it return type should be mentioned as void. This will be more clearer to you when methods are covered. If you know C then you know this already.

main is the method name. According to Java naming convention and specifications the main method should be named only to main. That's why it is defined like that. () indicates that it is a method.

If you want to pass any values to main method at command prompt then the main method should be capable of reading and strong them (the values or data given by user) so that it can be processed. For this purpose String args[] is mentioned. String is the class name and args is the variable of type String and [] indicates that it is going to store an array of String values. Again please don't worry if you are not getting this. This will be more clearer to you when we discuss array declaration syntax.

The main method code should be mentioned within the braces only. Thats why {} are used.

In order to display some thing on screen we can use println method. But printing is not that simple as compared to C. It is called via System class. out is an object. The System class exists in java.lang package. It is imported by default if you don't import it. Please remember the syntax for now, because you are new. All the details will become more clearer to you when we cover more concepts related to them.

In order to understand this Hello World! program we need to know lot of concepts. I had just given some brief idea to make aware of the program. Of course I know that this is not enough to you to understand perfectly.

Those who already know Java may find this session not much useful. Sorry but I had started this tutorial keeping a beginner in mind who just knows that Java is just a programming language and nothing else!

Hope the session is useful to you. Don't worry nothing is going to happen to you if you don't understand it. If possible read this post once again. Also follow the tutorial order accordingly. Don't go for next tutorial before covering the previous tutorial.

Let me know your feedback via comments!  

Java Basics

Hi friend Good morning! Welcome to our new session. But don't think features of Java post is over. I will update it time to time.


Today we are going know things that are needed to understand our first Java program. A person who already know Java may not need this post.

Generally you are going to write a program to instruct computer to perform your desired task. The program written by you simply contains code written in English. If a language code is written in plain english, easily understandable format you can say that it is an example for high level language. Java is a high level language!

Also remember that the code written by you is known as source code. Every file in computer system contains some extension so that it can be easily identified by OS. For instance the image files in your computer System will have .jpg extension and the audio files generally have .mp3 extension. Like the same way a C program will have .c extension and a Java program contains .java extension.

We are going to write our code in this .java extension file. But here is a catch. If you are going to write your code in english words (of course you have to follow language rules and syntaxes) then how computer is going to understand your commands because it doesn't know other than binary language or machine language.
So you need a mediator who can convert your code in machine understandable format.

Translators are needed to convert your code from one format (high level) to another (machine format). There are two types of translators. They are Compilers and Interpretors. Compiler is going to translate whole code into machine format at once. Whereas interpretor is going to convert it line by line.

In Java compiler is used to translate our code into Byte code. Byte code in Java is having the extension .class. But byte code cannot be executed by our system directly. For this Java provided JVM (Java Virtual Machine). JVM is going to execute the byte code directly and we will get our results. That means JVM is also one type of translator. Of course it has many reponsibilities. But remember JVM executes code line by line, that means it is an interpretor.

We already discussed that Java is platform independent. Here in this post we will see how this is happening. We came to know that after compiling we are getting one file known as .class file. This class file is machine independent. That means if you are going to compile a Java program on Windows XP, you will get one .class file. The same .class file you can copy and place on another system like LINUX. You don't need to chance any thing. The JVM present on linux system can execute this .class file and it will give results on the fly.

Here is a tricky question asked in interviews.

Is JVM platform independent?

Don't get confused. I am asking about JVM and not Java. Actually JVM is machine dependent. For every operating system Oracle provided separate JVM so that it can easily interact with OS. That's why in my first post I told you to download one software which is specific to your need like JDK1.7x86.exe. For linux you have to download separate file. This JVM is provided inside this software. So Oracle provided separate software depending upon your OS. This clearly shows that JVM is platform dependent.


Hope the idea regarding JVM is somewhat clear to you now. Let me know if you are still confusing.

I will deal with program in the next post. 

Java Naming Conventions

Hai friend Good morning! Welcome to Java session. Today we are going to discuss some naming conventions to be followed in Java.


Class names in Java should start with capital letter. If the class name contains two words, the first letter of both the words should be capital. Also method names should start with small letter and the sebsequent word first letter should be capital. Every statement in Java should end with semicolon.

Java language has certain keywords. Keywords are certain words which are having special meaning to Java and hence these keywords should not be used for other purpose other than for what they are meant to.

In Java if you want to store any value then you should declare one variable to hold the value. Variable is nothing but named memory location where a value can be stored. Also remember that variable value changes during program execution. That's why it is termed is variable. Some times it is also referred as Identifier. There are some rules when you are going to name variables.


Variable naming conventions in Java:

  • Keywords are not allowed to name a variable.
  • Variable name can contain any number of characters. But it is recommended not to go for long names because it is difficult to remember it at a later stage.
  • Variable name should not contain any special characters except $ and _. I mean $ and _ are the only special characters that are allowed to name a variable.
  • Variable name should always start with an alphabet or special character $ or _. It should not start with a number.Of course the second character onwards numbers are allowed. Even though first character can be $ or _ it is not recommendd to use them.
  • Java is case sensitive. That means upper (capital) and lower (small) case letters are always treated as different.

List of Keywords in Java

Hi welcome to the Java session. Today we are going to see the list of keywords available in Java.

We already know that keywords are reserved words which are having special meaning to the Java language. Hence we are not allowed to use keywords to name a variable, method or class name etc. A total of 50 reserved words are there in Java.

The list of keywords are:

  1. abstract
  2. assert (This is added in JDK 1.4)
  3. boolean
  4. break
  5. byte
  6. case
  7. catch
  8. char
  9. class
  10. const (This is not used)
  11. continue
  12. default
  13. do
  14. double
  15. else
  16. enum (This is added in JDK 1.5)
  17. extends
  18. final
  19. finally
  20. float
  21. for
  22. goto (This is not used)
  23. if
  24. implements
  25. import
  26. instanceof
  27. int
  28. interface
  29. long
  30. native
  31. new
  32. package
  33. private
  34. protected
  35. public
  36. return
  37. short
  38. static
  39. strictfp (This is added in JDK 1.2)
  40. super
  41. switch
  42. synchronized
  43. this
  44. throw
  45. throws
  46. transient
  47. try
  48. void
  49. volatile
  50. while

Apart from the above keywords true, false and null might look like keywords, but actually they are not keywords. Still these are not allowed to name a variable.

Do remember that main is not a keyword in Java. That means main can be used for naming a variable. Of course it's a bad programming practice!

All these keywords will be covered in our tutorial. Hope the today session is useful to you. 

Data Types in Java

Hi friend! Today we are going to discuss primitive data types available in Java.


Java basically supports eight primitive data types. Data type is generally going to identify what type of data is going to be stored in the memory location.

Let us see why we need data type? In general we use to represent data either in number format or non number format. The data which is going to be represented may occupy some memory. Small numbers may need less memory and big numbers may need more memory. Like the same way your name is nothing but a collection of characters which need memory based on number of characters present in it.

Hence languages defined data types so that memory can be utilized efficiently and data can be identified by just seeing the data type. In computers every thing is represented in bits. For example if you want to store a number say 9 then in binary language it will be represented as 1001. If the number is large then it occupies more bits.

In java every variable must be declared before using it in the program.

The eight primitive data types are as follows:

  1. byte: This is used to store integer values. In this we can store any number between -128 to +127. It occupies one byte of memory (8 bits). Why the limit is upto 127? Because 127 is the largest number that can be represented in 1 byte memory. Convert it into binary and see how many bits you are having! Do remember that one bit is reserved for sign. If the number is positive then the sign bit value will be zero otherwise one.
  2. short: This is also used to store integer values. But it has longer range as compared to byte. The range is from -32768 to +32767. It occupies 2 bytes of memory.
  3. int: This is also used to store integer values. This can accommodate values larger than short data type. The range is from -2,147,483,648 to +2,147,483,647. Both the numbers are inclusive. It occupies 4 bytes of memory.
  4. long: This is also used to store integers. This can have values which can't fit in int data type. The range includes -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807. It occupies 8 bytes of memory.
  5. float: This data type is used to store real numbers. Numbers which are having fractional part in it. It occupies 4 bytes of memory.
  6. double: This is also used to store real numbers or floating numbers and its range is always greater than float. It occupies 8 bytes of memory.
  7. boolean: This data type can have only two values either true or false. Generally it represents one bit of information.
  8. char: This data type is used to represent a single character. Every key on the keyboard can be considered as a character. It occupies two bytes of memory.
Apart from the above 8 primitive data types Java supports collection of characters as a String data type. Don't confuse it with basic or primitive data types. String is a predefined class in Java.

When we do programs on the above data types then you will get more clear idea on these data types. Hope today's session is useful for beginners.

Control Flow Statements in Java

This post is part of Java Tutorial. This post is applicable for all people who are following Java Tutorial.Today we are going to discuss various control flow statements available in Java.

In Java ( also in C,C++) the flow of control is sequential. I mean statements are executed line by line. After the execution of first statement, control goes to second statement and then third and so on. The program will be terminated after the execution of last statement. So statements are executed from top to bottom.

Some times we need to break up the flow of execution. We need to execute first statement and then based on certain condition we may go for second statement or we can directly jump to sixth statement. To do this type of task control flow statements are there in Java.

Control flow statements break up the flow of execution by employing decision making, looping, and branching. In Java decision making statements are if, else, switch, the looping statements are for, while, do-while, and the branching statements are break, continue, return.

if statement:
Using if we can execute a statement (or block of statements) based on the condition specified using if. If the condition is true then only the block of statements will be executed. Otherwise the block will be simply skipped.

Syntax of if statement:

if(condition)
{ // block start

//executable statement1
//executable statement2


// block end
}
Note that { } (curly braces) are not necessary if there is only one statement in the block.

Syntax of if-else statement:

if(condition)
{ // block start

//executable statement1
//executable statement2


// block end
}
else
{ // block start

//executable statement3
//executable statement4


// block end
}

Like this we can also define another 'if' after the 'else' part. This is termed as nested if.

switch statement:
switch works similar to if-else statements. It provides better readability as compared to if-else. The General Syntax of switch is:

switch(variable)
{

case value1: // code to be executed;
break;
case value2: // code to be executed;
break;
.
.
.
default : //code to be executed;

}

In switch the variable is matched with corresponding value. If any matching value is found, that case will be executed. Observe we have given break keyword after every case. This is necessary otherwise all the cases after the matching case will get executed. The keyword break is used here to transfer the control outside of switch once our code has been executed.

Keyword default will only get executed if all the cases fails to execute. That means if none of the cases match then only default case will be executed. Default can be present any where in the switch block but it will always get executed after testing all the cases. Generally people use to write default as the last choice in the switch block. Also default is optional in switch.

while statement:
Some times we need to execute a set of statements continuously as long as the condition is true. To do such type of tasks we have while statement.

The syntax of while statement is:


while(condition)
{

executable code;
.
.
.
}

As long as the condition specified with in while loop is true the block of code will get executed. If the condition becomes false the loop will be skipped. We have to write code in the while block in such a way that every time the loop comes closer to the breaking condition. Otherwise the loop will not be terminated at all. such type of loops are known as infinite loops. Remember in while loop if the condition evaluates to false at first time then the block of code will not be executed at all. This is also known as entry control loop.


do-while statement:
Do while loop is also similar to while loop except one difference. In do-while loop the condition is tested at bottom instead of at top.

The syntax of do- while statement is:


do
{

executable code;
.
.
.
} while(condition);

Since the condition is tested at bottom even though it evaluates to false the loop will be executed at least once. Hence it is also known as exit control loop. Also observe after do while condition semicolon is necessary. 

Operators in Java


 Welcome again to Java session after a long gap. In today's session we are going to deal with various types of operators in Java.


Let us assume one statement c=a+b. In the above statement we can say that variables a,b and c are operands. Whereas + and = are operators.

An operator is a one which is going to perform some action on operands.

Here + is used to add a and b and again = is used to assign the result to variable c.

But here there is a catch. In mathematics some times we may even write a+b=c and c=a+b but in Java you are not supposed to write a+b=c because a+b contains some value. And we cannot assign some variable to value. But we can assign a value to a variable. I mean c=a+b is just fine. I think this is clear to you.


Arithmetic Operators:

Java programming language provides operators that perform addition, subtraction, multiplication, and division. These operators are similar to the operators found in basic mathematics. The only symbol that might look new to you is %, which divides one operand by another and returns the remainder as its result.

+ (Addition Operator, also used to add two strings)
- (Subtraction operator)
* (Multiplication operator)
/ (Division operator)
% (Remainder operator)

Assignment Operator:

The assignment operator available in Java programming language is =. We already know that the purpose of this operator is to assign a value to a variable.

Compound assignment operators are also there in Java as like in C. For instance if you want to increment a variable value by 10, we generally write a=a+10. The same statement can also written as a+=10. So we can say that +=, -=, *=, /=, %= can be called as compound assignment operators (there are many more!).


Unary Operators:

The unary operators require only one operand; they perform various operations such as incrementing/decrementing a value by one, negating an expression, or inverting the value of a boolean.

+ (Unary plus operator. This indicates positive value)
- (Unary minus operator)
++ (Increment operator; increments a value by 1)
-- (Decrement operator; decrements a value by 1)
! (Logical complement operator; inverts the value of a boolean)


Equality and Relational Operators:

== (Equal to)
!= (Not equal to)
> (Greater than)
>= (Greater than or equal to)
< (Less than) <= (Less than or equal to) Conditional Operators:

&& (Conditional-AND)
|| (Conditional-OR)
?: (Ternary operator this is a shorthand for if-then-else statement)


Bitwise and Bit Shift Operators:

~ (Unary bitwise complement)
<< (Signed left shift) >> (Signed right shift)
>>> (Unsigned right shift)
& (Bitwise AND)
^ (Bitwise exclusive OR also known as XOR)
| (Bitwise inclusive OR)

We will cover these operators in more depth when the need arises. Let me know about your feedback regarding today's session by commenting below.

How Facebook Can Ruin Your Life

This post is for those people who spend too much time on social networking site Facebook. All the views presented in this post are of my own and you need not agree with them.


Hi friend don't get me wrong. I too love facebook. But I believe some people are using facebook in way which is not supposed to be.

It is human nature people share only the good stuff on their facebook wall. You can have your status say something funny or something wise. You can share something cool or something that will make your friends jealous. Even if you are being yelled at by your father, you can type in your fake status about enjoying the day at home! Nobody needs to know, you can pretend, nobody needs to know real you!

Nobody admits it and perhaps many don’t even realize that the online portrayal is far from who we really are. In the process, we end up creating an online place that is far from reality. The online life that you portray is often not the real life, and it is always influenced by the wishful thinking of the depths of your brain.


How to identify if Facebook is controlling you? At first let me see if you come under these symptoms:


  • You spend more than 30 minutes a day on Facebook.
  • You communicate with people more on Facebook than you do in real life.
  • If facebook is unable to open on a particular day you get frustrated.
  • You post critical things related to you directly on your wall.
  • You often visit all your friends profile to see what is happening there.
  • When you are on facebook you avoid people who are nearer to you in real life.
  • You prefer to chat with people rather than to talk via phone.
  • You have ever revealed something deeply personal on Facebook that you have regretted later.
  • You go on Facebook mostly to meet strangers and play games.



Negative effects of Facebook


Addictive: If you use Facebook regularly, you know exactly how this site can be addictive. You may be always updating your status, checking on others, or just mingling with strangers etc. Facebook puts a variety of powerful options on your fingertips and you are hooked for hours and hours every day.

Personal privacy: Many of us pay very little attention to all the information we put online, some of it quite personal. Where you live, your contact information, what you do, where you go. You may be opening the doors for others to intrude on your life. Even with all the privacy settings, lots of so called friends have access to your personal information, a lot more than you may want to. The risk is more if your account is compromised.

Employer may use Facebook against you: Your employer may use facebook to check what you are doing. Also, most of the companies and workplaces don’t want anyone to be wasting their productive time on the Facebook. What you say or what you share on Facebook may come back to bite you, sooner or later :).

Easy to lie and deceive: Nobody is watching you. Nobody can see you. People can live their fantasies on facebook. Anyone can make a fake profile with a fake picture and pretend to be whoever he/she wants. That is the ugly side of FB, you can never be certain about facebook friends you have never met in real life.

Frequent annoying status update: You often find some strange and useless status updates on facebook, all the time. What you had for breakfast, what was the score of your local team that no one has heard of, what color of shoes you are wearing. The status update is often over done and meaningless. And, if you breakup with your gf/bf, you can announce I am single again within seconds.

Society of loners: Facebook has become a place to pass time if you have nothing better to do. Many facebook users hide in their rooms and log onto FB, rather than socializing with actual friends and family. Those who don’t socialize in real life may prefer to add excessive friends on FB and feel social online. In some cases, the online social networking tool could actually encourage you to be anti-social and loner in your real life.

People may spy: Your profile page is full of information about you like who you are, where you work at, what is your favorite music, your favorite movies, books and TV series, what are your religious and political beliefs, your studies and other areas of your interests. As a matter of fact, you share too much information with other people, who are totally strangers. Some Facebook users take higher risk and put on their home addresses and phone numbers on the profile. This is probably how strangers find their way home without needing to chat first.

Open secrets:You tend to share your date of birth and place of birth on your profile. But actually all these details can be used to hack your bank account where some security questions related to you asked in order to authenticate. An intruder can easily get these details via your facebook profile. Of course you may provide security by making your profile info invisible to strangers. Imagine the effect if the stranger becomes your friend?

Facebook may be considered a cool social networking tool for some people, but in reality, it is just a fake book for others!

Some strange and true facts related to facebook:

"Facebook has resulted in more divorces and break ups than building relationships."

"Facebook addiction causes the same changes in the brain that are seen in cocaine users."

"Facebook makes you overestimate how happy your friends are, in turn makes you more depressed."

"Facebook is linked to one out of every five divorces in the United States."



Facebook can work great In many cases like you can catch up with old friends, find valuable information, promote your work and your business, support really important causes and meet people who can be real friends in the process. What is wrong with Facebook is the ritualistic involvement that turns into addiction and which takes you away from your real life by triggering you to log on several times a day.

"Life is to live, there are thousands of things waiting for us in the real world." 

Opera Mobile Tips and Tricks

Opera is providing rich internet browsing experience for mobile phones by using Opera Mini or Opera Mobile. Opera is the most popular browser for mobile phones especially for Symbian powered mobile. If you are using Opera Mobile then here are some tips and shortcuts for fast and easy browsing experience.


  • Opera Mobile can be used as a file explorer also. For this open the browser and in the address bar type file: or // or c: or d: or e:. All the drives present in your mobile will be displayed as icons and you can browse any file you like.
  • Opera Mobile supports right click by pressing the button 1 or long pressing the selection button or middle button (depending upon the mobile model).
  • Advanced users can tweak opera settings by typing opera:config in the address bar and change the required property value (don't use this unless you are sure).
  • You can enable Opera Turbo by going to settings and turn on Opera Turbo. This is going to compress the web page upto 70%. By this way your mobile browsing cost will be reduced greatly because some people use plans based on content download (i.e the more you browse, the more the content is downloaded and the more the amount is payable)
  • Scrolling can be done by using the keys 2 to go Up, 4 to go left, 6 to go right, 8 to go down and 5 to zoom in and out.

  • In Opera it is not possible to view source code of any website. But by using the code server:source (works in Opera Mini), you can view the source code in the form of html tags. You have to enter this code in the address bar after loading your desired site.
  • Some shortcuts are combined with * to have the following effects.* (up) to open new tab.*(left) to go for previous tab,*(right) to go to next tab,*(down) to close the current tab and ** to get full screen.

How To Verify An Indian Company Online

Numerous companies are coming everyday and we don't know how many of them are genuine. In order to verify a company is genuine or not Ministry of Corporate Affairs (MCA), Government of India maintains database of every company registered in India.

If you want to check each and every details regarding a company like:

  • Company Registration Number
  • Company Identification Number (CIN)
  • Company Category like limited by shares or not
  • Whether the company is Private LTD or Public LTD or Government Company
  • Authorized Capital of the company
  • Company Date of Incorporation
  • Company Address details etc.

Then click on Company Master Details.

If you can't remember the company name exactly then you can also check by a particular word by which the name starts or ends or it may present anywhere in the company name by clicking on Check Company Name.

If you are unable to find a company in the search results that means the company is not registered within India or it may be considered as a fake company.

Do share this info with your friends so that your friend can easily recognize the trustworthiness of a company.