Posts

Showing posts with the label Mechanism

List of all keywords and reserved words in java

Java Keywords What is a keyword? Keyword is a special word/reserved word which is already defined in the compiler. We can not use keywords in our program for declaring any variable or program name or in other declarations. Keywords definition is defined in the compiler. For example, If you try to declare a variable with name 'try' that is not possible as 'try' is a keyword in java language. See following example.      class Testpgm  {     int try; //this variable can not be declared....     public static void main (String[] args )       {        //class code....       }    }   Below is lists of all Java keywords- There are 53 keywords in java. 1. 48 special words. 2. 3 special words. 3. 2 unused words. 2 unused keywords ================ 1. goto 2. const 3 reserve words =============== 1. null 2. true 3. false 48 special words ================ keywo...

What does Java Compiler do

Job of Java Compiler Before knowing What does Java Compiler do or Job of Java Compiler, You should know What is a compiler? Compiler is a collection of predefined programs which convert source code into machine understandable code. In case of Java Compiler source code is not converted into machine code  directly , It is first converted into Byte code then translated into machine code by JVM . But other compiler directly convert source code into machine code. For ex- 'C' Compiler. Due to this feature of Java, It is a Platform Independent Language . Java has both the Compiler and Interpreter. Compiler converts source code into byte code and the Interpreted i.e. JVM converts byte code into machine code. Job of Java Compiler- 1. Java Compiler loads source code from Hard Disk to RAM. 2. Java Compiler converts source code into Intermediate code if source code is syntactically     correct. 3. Generate Byte Code i.e.  .Class file. Note-   By defaul...

Internals of Stream in Java

Why do we need Stream? As we know that Stream is a sequence of data. So we need need this Stream to access data so that we could do I/O operation on that data. Below are some reasons which will tell us why do we need stream. 1)In order to perform input/output operation ,we need Stream. 2)Without Stream ,we cannot perform input/output operation. 3)To save your output and input in the hard-disk permanently,we need Stream. Example ======= Banking Application(Before came to the concept of database, developer used STREAM for developed bank application or etc).

Internal mechanism of File Handling in java

Internals of File Handling in Java File Handling is a very important topic in java. We can read, write, update files through file handling. It gives us authority to modify files through this mechanism. We will read here internal mechanism of file handling. How files are being read, How Input/Output operation are being performed on file. In order to read about all this we need to understand STREAM. We will discuss here-   * Why do we need Stream?   *What is Stream?   *What is INPUT?   *What is OUTPUT?   *What is Input Stream?   *What is Output Stream?   *What is Byte Stream?   *Why do we need Byte Stream?   *What is Character Stream?   *Why do we need Character Stream?   *How many ways to take Input from keyboard? We will get all answer here while reading all posts. First I would like to tell you concept of File Handling. File Handling- We can  read or write som...