التخطي إلى المحتوى الرئيسي

المشاركات

عرض الرسائل ذات التصنيف Java

What is Java ? ,java introduction,Java definition, Java Fundamental

                    About Java:- Java is  a complete technology or platform,  which is used to create small scale to large scale application’s using Java Programming language, Java Development Kit and Java Frameworks. Java Technology Provide a complete platform to compile and execute the java program code using JDK and JRE . Java code converted into byte code by java compiler under JDK. Java Technology uses JVM (Java virtual machine ) to execute java byte code to any operating system hence Java is platform-independent but JVM dependent. JVM  is part of JRE. JVM is a subpart of JRE which is also called the virtual operating system of Java. In the developer machine, JDK and JRE both are required, but in the client machine, only JRE is required. About Java Programming language:- Java programming language is an Object-oriented programming language which is used to create a real-world based application for end-users. ...

How to install Java in machine?

1) To install Java Software in machine first we download Java set up from this link https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2) Extract Zip file and Install them 3)  It provide complete environment of JDK and JRE under C:/Program Files/Java/JDK C:/Program Files/Java/JRE 4)  Set path of C:/program files/java/jdk/bin  Right click on my computer|My pc  ---> Properties  ----> Advances System Setting ---> Environment Variable---> Click on New Button (User Variable) Variable name:-    path Variable value:-  C:\Program Files\Java\jdk1.8.0_161\bin 5) click on OK,OK,OK Button JAVA SAMPLE Program import java.util.Scanner; class Swap {    public static void main(String args[])    {       Scanner sc = new Scanner(System.in);       int a,b;       System.out.println("Enter First Number");       a=sc.nextInt();...

How to create First "Hello World " Program in Java

1)  Check Java Environment Java software is installed in the machine or not, In the windows machine, we can check under c:/program files/java folder it should contain JDK and JRE both. JDK means Java Development Kit, It provides program compilation means convert java program code to byte code. JRE means Java Runtime Environment, It is used to Execute Java Byte Code to machine code using JVM (Java Virtual Machine), JIT (Just-in-time) Interpreter exist under JVM which is used to execute byte code result. If the Java environment is not set then install JAVA using JDK and JRE. 2)    Check the Java Environment path that it is set or not.  Open the command prompt and type javac , if javac will be described then the path is set otherwise the path is not set if javac not recognized internal or external command ... How we set java path:- Right click on mycomputer----> propeties  ---> Advance System setting ----> Environment Variable-----> New --->  ...

Complete Program Explanation of Java

class Hello {    public static void main(String abc[])    {        System.out.println("hello world");    } } // class is the blueprint of the object, it is used to define the functionality of the object using data member and member function. we can define a single object and multiple objects definition both using class. {}    --->  it is called token of class which is used to define block, all block-level statements will be defined by this. for example if-else, switch, loop, function, etc public:-    it is an access specifier  or access modifier that is used to define the scope of the data member, member function, and class, the public can be accessible outside of the project, package, method, and class. static: - it is called a non-access modifier of java that provides compile-time memory allocation means if we create a static variable then its memory will be fixed but a value can be changed...

Classification of JAVA:-

Java has classified into three different types. Java technology has been divided into three different editions there have no core java and advanced java word for Java, Java has J2SE, J2EE, and J2ME. Means Java divide into three different edition 1)  J2SE  (Java to Standard Edition):-   It is used to create a Desktop Application 1.1)  Java Fundamental (Variable,Operator,If--else,Loop,Array) 1.2) OOP'S 1.3) String 1.4) Exception 1.5) File Handling 1.6) Threading 1.7) GUI Programming (AWT, SWING) 1.8) DB Programming (JDBC) 1.9) Collection Framework 2) J2EE (Java to Enterprise Edition):- It is used to create Dynamic Web Application, Enterprise application. Website, Web portal, and Web Software. Without Framework:-   2.1) JSP   2.2) Servlet   2.3) Java Bean Class   2.4) DB Programming   2.5) AJAX   2.6) Session   2.7) Cookie   2.8) Navigation 2.9)  Filter 2.10)  Upload & download 2.11)  Template and design...

Naming Convention in Java:-

Java Language Provide Four Different Types of Cases to write the name. When you will write code then you should focus on the naming convention, it provides the ways to provide the name of Variable, Constant, package, Methods, Class, and Interface. 1 lower case:-   for a keyword, for variable, single word method, package-name example class, static, void, main these all are a keyword in java, it's have been defined in lower case. 2 Proper Case or initial or Capitalize:- Classname, Interfacename 3 Camel Case:- the first word all char in lower case and the second word first char will be in caps and the same pattern will apply to all words. The method nam e which contains more than one word will be in Camel case in java. toString() indexOf() lastIndexOf() 4 Upper case:- Constant in Java should be declared in Upper Case. ASSIGNMENT OF JAVA Program:- 1 WAP to create a Salary Calculator of an employee using basic, ta, da, comm, pf, number of leave.    calculate net salary and g...

JVM Introduction

What is JVM? JVM means Java Virtual Machine , It provides a complete Runtime Environment to Execute Java Byte Code. JVM is the part of JRE means when we install JRE in the machine then JVM Environment will be created by default. JVM Component:- JVM Architecture? JVM means Java Virtual Machine, It will divide the complete runtime environment into four different parts. 1)  ClassLoader SubSystem:-   1.1)  Loading  --->  When we execute the program the loader will load the class files using Bootstrap, extension, and application loader.   1.2)  Linking  ---->  It is used to link all libraries of byte code that will be used into the java program   1.3)  Initialization--->  after successfully loading and linking, the byte code file will be initialized into memory. 2)  Memory Area  2.1)  Stack Memory:-   It is used to store the data for value type data type for example, int, char, float, boolean, and ...

Data Types in JAVA

Data Types concept in java:- It is used to represent the  pattern of data and the size of data  in memory. The datatype is mandatory to declare a  variable, constant, method, and properties  in  java. int x;             datatype on  Variable final int X;   datatype on  Constant int addition()    datatype on Method {       return x; } Type of Data type in java: 1 Primitive Datatype:- all C and C++ data type is supported in Java int   ----------------------------------------------> 4byte short ---------------------------------------------> 2byte long ----------------------------------------------> 8byte char  ------------------------------------------->    2byte byte  ---------------------------------------------> 1 byte float  --------------------------------------------->  4 byte double ---‐-----------------------‐--...

Variable and Constant in Java:-

Variable or Data Member: -  It is a special identifier whose value can be changed at compile-time or runtime. Variable declaration Syntax:-  access modifier + non access modifier +  datatype + identifier  public                     static         int               x int x =10 ;     //default instance int x=10 dynamic memory allocation using object static int y=20 //  default static int y=20 one-time memory allocated at compile time Types of variables:- 1 Instance or Dynamic:- It will be declared without any static modifier and it will allocate memory at the time of execution by the object. a variable that will be declared underclass or under instance method without using static modifier will be an instance variable instance variable will never declare under the static method but it can be used. this type of variable is also ca...

implicit and explicit conversion,boxing ,unboxing and auto boxing a concept in java

String s = "hello"; String s1 = new String("hello"); String s2= "hello"; implicit and explicit conversion:- boxing, unboxing, and autoboxing a concept in java:- implicit or boxing:-  it is used to convert primitive type data to object type. it will be automatically implemented hence it is called an implicit conversion. int a=10; Object o; o=a;  //implicit explicit or unboxing:-  it is used to convert derived type data to a primitive type. for example, if we convert Object type data to integer type then it is called explicit conversion Object o=20; int b; b =(int)o;  //explicit Autoboxing:-  It is used to convert all primitive type data to respective wrapper classes, for example, if we convert int data to Integer, float data to Float, char data to String then these operations will be implemented automatically.  this concept is mostly used in the collection framework in java. int a=100; Integer a1 = new Integer(a); class Boxingunboxing {    ...

Operator tutorials in Java

It is used to perform operations using operand, the operand can be variable, constant, or literals . int a=10;  a is the variable,10 is the literals System.out.println(100+200) ;  100 ,200 is called literals. ..................................................................................................................................... The operator will be called by a symbol but defined as a method, for example, if we use + operator then + is the symbol but it has defined as  +() method Operator +(param1) { } Type of Operator:- 1) Unary Operator:-  This operator will work using a single operand. 1.1 Increment:-   increase current value by one 1.1.1  Post Increment:-        operand++      First complete other operations (print, assign) then increase the value        int a=5;        int b;        b=a++;    ...