Support Me ��


SUBSCRIBE NOW

Showing posts with label JAVA. Show all posts
Showing posts with label JAVA. Show all posts

Introduction to Java 1

Introduction to Java

Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Oracle Corporation took acquisition of Sun Microsystems in 2009-10. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

Fetures of Java :

  • Simple.

  • Object-Oriented.

  • Platform independent.

  • Secured.

  • Robust.

  • Architecture neutral.

  • Portable.

  • Dynamic.

  • Interpreted.

  • High Performance.

  • Multithreaded.

  • Distributed.

 

What is JVM ? 

Java Virtual Machine (JVM) is a virtual Machine that provides runtime environment to execute java byte code. The JVM doesn't understand Java typo, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM.


What is JRE ? 

The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.


What is JDK ? 

The JDK also called Java Development Kit is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications.

 

Applications of Java :

  • Developing Desktop Applications.

  • Web Applications like Linkedin.com, Snapdeal.com etc.

  • Enterprise Applications such as banking applications.

  • Mobile Operating System like Android.

  • Embedded Systems.

  • Robotics and games etc.


Introduction to Java 2


Introduction to Java 2

Creating 'Hello World!' Example

class Simple
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}

Save this file as Simple.java

To compile: javac Simple.java

To Run: java Simple

Understanding first Java program:

Let's see what is the meaning of class, public, static, void, main, String[], System.out.println().

class keyword is used to declare a class in java.

public keyword is an access modifier which represents visibility, it means it is visible to all.

static is a keyword, if we declare any method as static, it is known as static method. The core advantage of static method is that there is no need to create object to invoke the static method. The main method is executed by the JVM, so it doesn't require to create object to invoke the main method. So it saves memory.

void is the return type of the method, it means it doesn't return any value.

main represents startup of the program.

String[] args is used for command line argument. We will learn it later.

System.out.println() is used print statement. We will learn about the internal working of System.out.println statement later.

Introduction to Java 3

Introduction to Java 3

Notes & Basic Syntax:

About Java programs, it is very important to keep in mind the following points:

  • Case Sensitivity : Java is case sensitive, which means identifier Hello and hello would have different meaning in Java.

  • Class Names : For all class names the first letter should be in Upper Case. If several words are used to form a name of the class, each inner word's first letter should be in Upper Case.

    Example : class MyFirstJavaClass

  • Method Names : All method names should start with a Lower Case letter. If several words are used to form the name of the method, then each inner word's first letter should be in Upper Case.

    Example : public void myMethodName()

  • Program File Name : Name of the program file should exactly match the class name.

    When saving the file, you should save it using the class name (Remember Java is case sensitive) and append '.java' to the end of the name (if the file name and the class name do not match your program will not compile).

    Example : Assume 'MyFirstJavaProgram' is the class name. Then the file should be saved as 'MyFirstJavaProgram.java'

  • public static void main(String args[]) : Java program processing starts from the main() method which is a mandatory part of every Java program.

     

Basic JAVA 1


Basic JAVA 1

Variable in Java 

Variable is name of reserved area allocated in memory.

int data=50; // Here data is variable.

Types of Variable in Java:

  1. Local Variable
  2. Instance Variables (Non-static variables)
  3. Class Variables (Static Variables)

1) Local Variables:

Local variables are declared in method constructor or blocks. Local variables are initialized when method or constructor block start and will be destroyed once its end. Local variable reside in stack. Access modifiers are not used for local variable.

Ex: 

float getDiscount(int price)
{
float discount; //here discount is a local variable
discount=price*(20/100);
return discount;
}

2) Instance Variables:

A variable that is declared inside the class but outside the method, constructor or block is called instance variable . It is not declared as static.

Ex:

class Student
{
String name; //here name and age are
int age; // instance variable
}

3) Static variables:

A variable that is declared as static is called static variable. It cannot be local. Static variables are initialized only once. Static variables are also used in declaring constant along with final keyword.

Ex: 

class Student
{
String name;
int age;
static int instituteCode=1101;
} //here instituteCode is a static variable

Basic JAVA 2

Basic JAVA 2

Data Types in Java

Java language has a rich implementation of data types. Data types specify size and the type of values that can be stored in an identifier

In java, data types are classified into two catagories:

1) Primitive Data type

2) Non-Primitive Data type


1) Primitive Data type :

A primitive data type can be of eight types :

char  boolean  byte  short  int  long  float  double


A primitive data type can be of eight types :

Once a primitive data type has been declared its type can never change, although in most cases its value can change. These eight primitive type can be put into four groups:

Data TypeDefault ValueDefault size
booleanfalse1 bit
char'\u0000'2 byte
byte01 byte
short02 byte
int04 byte
long0L8 byte
float0.0f4 byte
double0.0d8 byte

2) Primitive Data type :

A reference data type is used to refer to an object. A reference variable is declare to be of specific and that type can never be change. We will talk a lot more about reference data type later in Classes and Object lesson.For example, Employee, Puppy etc:

Class objects, and various type of array variables come under reference data type. Default value of any reference variable is null.

Example: Animal animal = new Animal("tiger");

Backlinks

Website Design Company in Coimbatore
Website Design Company in Tamil nadu
Website Design Company in Karur
Website Design Company in Erode
Website Design Company in ooty
Website Design Company in theni
Website Design Company in thoothukudi
Website Design Company in Chennai
Website Design Company in Sathy
Website Design Company in Coimbatore Tamilnadu
Cheap Website Design Company in Coimbatore
Adsense Website Design Company in Coimbatore
ecommerce Website Design Company in Coimbatore
school Website Design Company in Coimbatore
Academy Website Design Company in Coimbatore
Test Website Design Company in Coimbatore
Best Website Design Company in Coimbatore
Adsense Website Design Company in Coimbatore
Adsense Website Design Company in Tamil nadu
Adsense Website Design Company in Karur
Adsense Website Design Company in Erode
Adsense Website Design Company in ooty
Adsense Website Design Company in theni
Adsense Website Design Company in thoothukudi
Adsense Website Design Company in Chennai
Adsense Website Design Company in Sathy
Free SEO Tools online
Free SEO Tools online Website
Free SEO Tools online Plagiarism
Free SEO Tools online article rewriter tool
Free SEO Tools online article reading and writing criticism
Free SEO Tools online seo backlink
Free SEO Tools online Free backlink maker
Free SEO Tools online seo backlink strategy
Free SEO Tools online content writting
360 help SEO Tools online Plagiarism checker
360 help SEO Tools online seo backlink
360 help SEO Tools online Free backlink maker
360 help SEO Tools online content writting
360 help SEO Tools online article rewriter tool
360 help SEO Tools
360 help SEO Tools India
360 help SEO Tools Tamil
360 help SEO Tools website