Posts

Showing posts from August, 2017

First Program in Java

// WAP in Java that prints Hello World. public class HelloWorld{           public static void main(String[ ] args){                     System.out.print("Hello, World !!!!!!");           } } In above ( // ) sign represent a comment in a program. What ever we write after ( // ) symbol, it is ignored while the process is compiled. Symbol ( // ) is use to comment a single line and ( /*..........*/ ) and this symbol is used to comment a multiple lines in program. Writing a comment in the program is good habit of a programmer. It helps other programmer to read and understand the program. // WAP in Java that prints Hello World.  Note:- this line will be ignored by the compiler while compiling the process. -------------------------------------------------------------------------------------------------------------------------- // WAP in Java that prints Hello World. public class HelloWorld {           public static void main(String[ ] args){                     S

Primitive Data types in Java

Java programming language is very strong language. In java, all the variables and objects must have an explicit defined data type. The main role of this type is to tell the compiler that how much memory is needed to store the value of variable. In java we found that there are 2 types of data types. 1) Primitive data types. 2) Reference data types. Primitive data types are name of reserved keywords. It is special data type built into the java language. The memory space is already allocated when the variables of primitive data types are created. But in reference data types, memory space has to be allocated using the new keywords. Java supports eight primitive datatypes. They are:- Data type                     Description                              Size/Format                               Range byte                           Byte-length integer             8-bit signed two's complement           -128 to 127 short                             short integer                

The Java Development Environment

One of the key feature of Java is portability. The computer program written in Java language can run of any supported hardware and operating system platform. Simply we can write the source code once and run it anywhere in any kind of OS. Source code in Java are compiled into an intermediate, platform independent code known as byte code. Bytecode  is a set of instructions analogous to machine code but intended to be interpreted by  the Java Virtual Machine (JVM) written for the host hardware. Unlike compiler which  is indeed a very complex programme, a Bytecode interpreter is a much simpler  programme, just like JVM. This makes it easy to write a Bytecode interpreter for a  new computing platform. Despite the great benefits of compiling into Bytecode, the primary concern is the  overhead of interpretation that interpreted programmes that run slower than  programmes compiled into native executable code. In fact, this was the primary  challenge faced by Java in its early days of introduct

Concept of Object, OOP, terms and terminologies

Image
Object means all the things around us like book, pen, car, table, human, animals etc. Object what actually represents, self contained entity that has attributes and behavior. lets, talk about human. A person is self contained entity because they have attributes and behavior. A person has attributes like weight, height, color, hair etc. and also behavior like they can walk , they can talk, laugh and so on. Entity contains the data that represents the attribute and behavior which actually refers the task that Object can perform. In Object Oriented Programming (OOP), software is the collection of Objects that interacts with each other to get the desire task done. According to traditional view, programs calls the set of predefined procedures. To understand what Object Oriented is, let's assume example in real world.  Suppose you got a call from your office, now you are in home. You should show your documents to your boss. What you do is you be ready and start the car and re

Introduction of Object Oriented Programming (JAVA)

Image
In this world, there are many kinds of languages spoken. They use languages to communicate with each other. And the language used by people is also known as 'natural language'. Similarly computers also use different languages and it is called programming language. Programming Language is a machine-readable language. It is specially designed to be executed by the computer system and it is also known as high level programming language. Java programming language is created by Gosling form the Sun Microsystems in 1991. It's main target of java programming language is to write once and then read multiple times in multiple operating system. In 1995, the first version of java was introduced (Java 1.0). Sun microsystem was acquired by Oracle in 2010. Sun started java available under GNU in 2006 General Public License (GPL). After that, Oracle continued this project name openJDK. Java's main features are platform independent, object oriented, JVM, JRE etc. Java Runtime Environ