Posts

Showing posts from December, 2020

Datatype in java

Image
Datatypes in java Data types specify the different sizes and values that can be stored in the variable. There are two types of data types in Java 1.Primitive data types:   The primitive data types include boolean, char,   byte, short, int, long, float and double. 2.Non-primitive data types:   The non-primitive data types include Classes,  I nterfaces, and Arrays. Primitive Datatypes in java  There are 8 types of primitive data types: boolean data type byte data type short data type int data type long data type float data type double data type char data type Syntax int a=10;

Java variables

Image
  JAVA VARIABLES A variable is a container which holds the value while the java program is executed. A variable is assigned with a data type. Variable is a name of memory location. There are three types of variables in java: local, instance and static. There are two types of data types in java: primitive and non-primitive. Variable  is name of reserved area allocated in memory. In other words, it is a name of memory location. Syntax : Variable  declaration int a=10; in above figure variable a allocated memory to store it's value i.e 10 . Types of variable in java There are three types of variable in java. 1. local variable 2. instance variable 3. Static variable 1) Local Variable:   A variable declared inside the body of the method is called local variable. You can use this variable only within that method and the other methods in the class aren't even aware that the variable exists. A local variable cannot be defined with "static" keyword. 2) Instance Var...

First Java Program

  How to write first program in java // Your First Program class HelloWord { public static void main (String[] args) { System.out.println( "Hello, Word!" ); } } output Hello, World! Explanation Note : If you have compiled the exact code, you need to save the file as  HelloWord.java . It's because the name of the class and file name should match in Java.  

how to set path in java jdk in window

Image
  Permanent Path of JDK To set the permanent path of the JDK on your system, follow the steps below. step 1   right click on This PC  and go to properties step 2 go to advance system setting step 3   Click on the environment variables in the tab step 4   Go to user variables and click on new. step 5   copy java path up to  bin directory step 6   Add the variable name as ‘path’ & copy path and paste  step 7  click ok  and then again ok 

Download and install java JDK in windows

Image
HOW TO DOWNLOAD & INSTALL JAVA JDK IN WINDOWS Following are the steps to download & install java jdk 8. step 1  open browser & type jdk 8 download ,click on first link i.e  click on link step 2  after that click on highlighted link. step 3  accept the license &  click  on download step 4  once downloading complete then run exe to install jdk & then click on next  button step 5   select the path to install jdk in windows & click next button   step 6   if your installation is completed then click on close button

Java and their feature

Image
What is   JAVA ? Java is high level programming language that is used to develop web application, mobile application and desktop application. Java  was started as a project called "Oak" by James Gosling in June 1991. Gosling's goals were to implement a virtual machine and a language that had a familiar C-like notation but with greater uniformity and simplicity than C/C++. The first public implementation was  Java  1.0 in 1995.   1. Simple   :  J ava is simple because it does not support operator overloading.      operator overloading:                                        String con = "one" + "two";                                        int a=10,b=20;                         ...