Posts

Data Types in Java Programming

Image
Data types in Java Java is  statically typed and also a strongly typed language  because, in Java, each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types. Data Types in Java Java has two categories of data:    Primitive Data Type:  such as boolean, char, int, short, byte, long, float, and double Non-Primitive Data Type or Object Data type:  such as String, Array, etc. Primitive Data Type Primitive data are only single values and have no special capabilities.    There are  8 primitive data types :    1. boolean:  boolean data type represents only one bit of information  either true or false , but the size of the boolean data type is  virtual machine-dependent . Values of type boolean are not converted implicitly or explicitly (with c...

JVM and Java compiler

Image
 What Is JVM ? In defth How JVM Works – JVM Architecture? JVM(Java Virtual Machine) acts as a run-time engine to run Java applications. JVM is the one that actually calls the  main  method present in a java code. JVM is a part of JRE(Java Runtime Environment). Java applications are called WORA (Write Once Run Anywhere). This means a programmer can develop Java code on one system and can expect it to run on any other Java-enabled system without any adjustment. This is all possible because of JVM. When we compile a  .java  file,  .class  files(contains byte-code) with the same class names present in  .java  file are generated by the Java compiler. This  .class  file goes into various steps when we run it. These steps together describe the whole JVM.                             Class Loader Subsystem It is mainly responsible for three activities. ...

Structure of Java program , basic programing interface of java

Image
unit-1 Java programming language is platform-independent and a secure programming language. With a wide variety of applications, Java programming language has been in demand for the last two decades. The out-of-the-box features help java stand apart. In this article, we will understand the structure of a java program in detail. Following are the topics discussed in this blog: Documentation Section Package Statement Import Statement Interface Section Class Definition Main Method Class t is used to improve the readability of the program. It consists of comments in Java which include basic information such as the method’s usage or functionality to make it easier for the programmer to understand it while reviewing or debugging the code. A Java comment is not necessarily limited to a confined space, it can appear anywhere in the code. The compiler ignores these comments during the time of execution and is solely meant for improving the readability...