Skip to main content

Posts

Showing posts from January, 2021

Java Virtual Machine (JVM)

 Java Virtual Machine (JVM)     All language compliers translate source code into machine code for a specific computer. Java complier also do the same things but Java compiler produce an intermediate code known as bytecode . This machine is called as Java Virtual Machine(JVM) and it is exists only inside the computer memory with java. It is simulated computer within computer and does all major functions of real computer.      The virtual machine code is not machine specific. The machine specific code is generated by the  Java Interpreter by acting as an intermediary between the virtual machine and the real machine. The interpreter is different for different machine. The java object framework acts as the intermediary between the user program and virtual machine which turns act as the intermediary between operatinf system and the java object framework.

Java Tokens

 Java Tokens     A java programes is basically a collection of classes. A class is defined by a set of declaration statements and methods containing executable statements. Most statements contain expression which describe the actions carried out on data. Smallest individual units in a program are know as token. The compiler recognizes them for building up expressions and statements.     In a simple terms, a java program is a collection of tokens, comments and white spaces. Java language includes five type of token.     Reserved Keyword     Identifiers     Literals     Operators     Separators Reserved Keyword:     Keywords are an essential part of language definition.  Keywords are the words whis defination is already known to java. They implements specific featues of language. Java has 50 reserved keyword.  These keywords, combined with operators and separators according to syntax, from definiton of java language. These keywords have some specific meaning in java, we can not use as na

Java Programe Structure

 Java Programe Structure     Java class contains may classes but only one class contain main method. Class contain data members and methods that operate on the data members of the class. Method may contend data type declaration and executable statements. To write program, we first need to define classes and then put them together. A java may contain one or more sections. Document Section:     The documentation section comprises a set of comment lines giving the name of programes, author details and other details of program. Comments must explain why and what are the cases. This will help in maintaining the program. For single line comment comment programer will use ' // ' forword slash and for multiline comment programer will use ' /* */ ' syntax. Package Statement:     The first statement allowed in a java file is Package statement. This statement declares a package name and inform the compiler that class defined here belong to this package. For example,     package

Object Oriented Concepts in Java (OOPS Concepts)

Java OOPS Concepts      Object oriented programing language provides many concepts, such as Inheritance, Data Binding, Polymorphism etc. Object:     Any entity which has state and behavior is known as object. It can be physical or logical part. For example, a chair, pen, keyboard etc.     An object can be define as instance of class. An object contains an address and takes up some space in memory. Objects can communicate with each other without knowing the details of each others data or code. Only the type of response and message acceptance is important. The representation of object is same as below: Class:     Class is a collection of object. It is logical entity. Class can also be define as a blueprint from which you can create individual object. Class doesn't consume any space. Sample example of java class declaration is as follows:     class SampleDemo{          // Statements or logical code          //  variable declaration with its data types           //  methods delaration

Features Of Java

 Features Of Java The main objective of Java Programing was to make it portable, simple and secur programming language. The features of java language is as below. 1. Simple:        Java is very easy to learn and syntax is simple, clean and easy to understand. Java syntax is base on C++ so easier for programmers to learn it after C++. Java has removed many complicated and rarely use features for example, explicit pointer, operator overloading etc. In java, there is no need to remove unreferenced object because there is Automatic Garbage Collection in java. 2. Object Oriented:     In java the data and methods can flow in the form of object so it is call Object-oriented programing language. Object oriented programming is a methodology that simplifies software development and maintain by providing some rules. The basic concepts of OOPS are:     Object     Class     Inheritance     Ploymorphism     Abstraction     Encapsulation 3. Portable:     Java is portable because you carry the Java b

Introduction of Java

 What is Java? Java is an object-oriented programming language developed by Sun Microsystem in 1995. It is a combination of C and C++ features with some essential and additional concepts. Java is suited for both standalone and web application development. Java can run on any hardware OR software environment which make it platform independent. Java Example:                                                                                           class Simple{     public static void main(String args[]){          System.out.println("Welcome In Java World");     } } In above example the 'Simple' is a Class name, public is access specifier , Main is a method with argument, String is a class, System.out.println() is use to print argument with value pass with it. All these concept we will discuss in different topic and its sessions.  Where is java being use? Earlier java was only use to design and program small computing devices, but after adopting platform independent fea