Skip to main content

Posts

Understanding Java

It is said " Write Once, Run Anywhere ". This is Java! Unlike any other programming language, Java is to be written once and can be compiled in any corner of the world. It is platform independent . How Java works? The aim is to write one program and make it work on whatever device your peers have! Create a source document using java Run your document through a source code compiler. The compiler checks for errors and won't let you compile until its satisfied that everything will run well. The copiler creates a new document, coded into java bytecode. Any device capable of running will be able to interpret/translate this file into something runnable. Rephrasing, the compiled bytecode is platform independent. Now, you can wish your friend "Happy Holi". Your friends don't have a physical java machine but the all have a virtual java machine running inside their electronic devices. The virtual machine reads and runs the byte code. This is what happen...
Recent posts

Operators in Java

Let's start coding! This post is all about operators in Java. Previous we had learnt about how to declare variables, what are the data types, how to initialize variables, etc and now you might want to know what to do with them. Operators are a good place to start with Java programming. What are operators in Java? Operators are special symbols that perform some tasks/ operations on more than one variables called operands and returns a result. Assignment, Arithmetic and Unary Operators Simple Assignment Operator " = ": This is the most commom operator that you'll come across. It's primary purpose is to assign the value from it's right to the operand at its left. Eg: int count=1; Here the integer type of variable 'count' is assigned the value 1.

Variables, Data Types and Literals in Java

Hi! Lets continue with our next topic! VARIABLES What is a Variable? A variable is just like a bottle. A bottle can contain only liquid and it can be of any type i,e, water, juice, milk, etc. For example, a bottle is of size 1 ltr. and filled with water. Note that the type and quantity of liquid is now determined i.e. the bottle can contain only 1 ltr. of water and not more than that.Similarly, a variable is a fixed size container depending upon its data type.. It also compulsorily has a name. There are some naming conventions which will be discussed later on! (camel case). Let's see the types of variables! There are three types of variables : Local / Global variables Instance / reference variables Static variables DATA TYPES What are Data Types in Java? Java is a strongly typed language i.e. a variable needs a data type before it holds some data. If you want to fill a container and you dont know what is going to filled in that container, java compiler...

Internal Processes of Java Program

We already know that a java file i.e. the source code is to be converted into class file i.e. byte code.  Byte code is a highly optimized set of instructions designed to be runned/executed by something called Java Virtual Machine, the JVM. Earlier or you can say, originally JVM was only the interpreter for byte code. Why is Java needed?          Java solved the major problem of security and portability by converting the source code into bytecode. this bytecode can be executed anywhere provided JVM is implemented. The execution of bytecode or class file  by the JVM is the most simple way to create portable programs.                  Bytecode also makes Java, secure. Since there is only one condition for a java file(here bytecode) to execute successfully that is JVM should be implemented into the machine where the bytecode is going to be executed.  Without JVM, bytecode is not going to be ...

Anatomy of Java Class

Click Here... The figure besides shows the structure of a Java class.  The four important terms that makes up the java file are : 1. Source File 2. Class File 3. Method 4. Statement What is a Source file?  A Java source file contains any number of classes. But the rule is, declare only one class as public and save the source file with name as that of public class. If not done so, you may get compile time error(Ugh! now what is compile-time error). Dont worry! it will be explained!. If public class is not defined, file can be stored using any name of your choice! Class File! Java is considered as relatively safe and secure because of its ability to convert a java program into a file coded in a stream of 8 bits. This file is generated by Java compiler and executed by The JVM. The class file is a byte code of a java program . Byte code of a java program is portable and readable only to JVM. This file is platform independent. Class file is just a ...

Setting up Java

If you don't have a 1.7 or greater Java Platform, Standard Edition SDK (Software Development Kit), you need it. The SDK includes everything you need to compile and run a java program. Follow the steps below and start programming in Java. Step 1 : Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. Here you will find numerous links out of which you will have to choose the one that suites your hardware configuration. Step 2 : Select the radio button saying "Accept Licence Agreement" and click on the suitable link. Step 3 : Save the zip file at a desired location in your computer. Step 4 : Unzip the folder and double click on the executable file that has been downloaded and click on "Run". Step 5 : Click on "Next". Customization is not allowed, Simply leave the default selection of Development Tools.(Requires 400MB of Disc Space). You can change the location from default installation directory...

Introduction To Java Technology

Java is a high-level programming language developed and released by Sun Microsystems in 1995, later acquired by Oracle Corporation. It was initiated by James Gosling and Patrick Naughton in 1991. Java technology is used to develop applications for a wide range of environments, from consumer devices to heterogeneous enterprise systems. Goal This tutorial covers the core APIs that you use to design object-oriented applications with java. This tutorial also covers the important concepts required to further develop your skills with java language and prepare for Oracle Certified Professional, Java SE 7 Programmer exam. Objective After completing this session, you should be able to write a basic java program and execute the program from commandline. Audience The target audience include those :  who have some basic understanding of 'C' language. Software Developers who are not yet experienced with java code or java platform. Developers who are havi...