Core Java
By: Gaurav Srivastav
Introduction
General
Purpose Object Oriented Programming Language
developed by James Gosling for Sun Microsystem in 1991.
It
was designed for the development of software for consumer
electronic devices like TVs, VCRs.
It uses the concept of C++.
Simple, Reliable, Portable and powerful programming language.
Java Environment
Java can be run on multiple platforms like Windows Linux Solaris.
Reason Behind being platform independent is that it does not executes on the
system directly but it runs on Java 2 platform and it comes with complete
package.
Java 2 platform is combination of JVM and Java API.
JVM : it is software implementation of a hypothetical computer.
JAVA API: A set of software component which provide interface to write the java
program.
JAVAC
It converts Java Source code into binary program that is called as
bytecode.
Bytecode is read JVM and Java Interpreter executes the java code.
Compilation of Java Program
Write the code on jEdit, NodePad etc. Save it with .java extension.
Compile it :
javac [Link]
Java Abc
Run:
Example
public class Hello
{
public static void main(String args[])
{
[Link](Hello);
}
}
Java Features
Simple
Object-Oriented:
It focuses on DATA=objects and on the interface of the object. e.g. Car
Manufacturing.
Distributed
Robust
Secure
Portable
High Performance
Dynamic
To Do
Explanation of OOPS.
Features of OOPS and their description.
Variables
These are memory locations on which data stores on the run time.
It holds the temporary data.
These are defined with a data type.
There are three types of variables:
Local Variable
Instance Variable
Class/Static Variables.
example
class myClass
{
Public int number1;
Public static int number2;
Void myfunction()
{
Int number3;
}
}