UNDER THE GUIDENCE OF
PRINCE MALHOTRA (Manager)
Java is a high-level programming language originally
developed by Sun Microsystems and released in 1995.
Java runs on a variety of platforms, such as Windows ,
Mac OS, and the various versions of UNIX.
Used in :
#Desktop Applications
#Web application
#robotics
#Games
#Mobile
#SIMPLE
#OBJECT ORIENTED
#PLATFORM INDEPENDENT
#SECURED
#MULTITHREADED
#ROBUST
Designing programs using classes and
objects..Simplify software development and
maintenance by providing concepts:
#object
#class
#inheritance
#polymorphism
#Abstraction
#Encapsulation
Abstraction is a process of hiding internal details
and showing only functionality to the user..
Ways to achieve abstraction:
# Abstract class
# Interface
abstract class Bike { abstract void run(); }
class Honda extends Bike {
void run() { System.out.println(“run safely”); }
public static void main(String args[]) {
Bike obj=new Bike();
obj.run();
}}
It is a mechanism to achieve fully abstraction and
multiple inheritance in java...
interface Printable { void print(); }
interface Showable { void show(); }
class A implements Printable,Showable {
print void print(){ System.out.println(“hello”); }
print void show(){ System.out.println(“Welcome”); }
public static void main(String [] args)
{
A obj= new A();
obj.print() ; obj.show() ; }}
class Bike {
void run() { System.out.println(“running ”); }
class Splender extends Bike {
void run() { System.out.println(“running safely”); }
public Static void main(String []args)
{
Bike obj=new Splender ();
obj.run();
}}
Default Constructor:
class B
{
B(){ System.Out.Println(“Welcome”)}
public Static void main()
{
B obj=new B(); }}
class S
{
Int id; String name; int age;
}
S(int i,String n,int a) { name=n; id=i; age=a; }
S(int i; String n) { name=n; id=i; }
void display(){ System.out.println (id+” ”
+name” ”+age) ; }
public Static void main(String args[]){
S ob1=new S(111, “ keran”);
S obj2=new S(231, “bhanu”, 23);
obj1.display();
obj2.display(); }}
Static property is shared to all objects..
class S {
int rollno; String name;
Static String college=ITS; }
#try
#catch
#finally
#throw
#throws
class A{
public Static void main(String []args) {
int a=integer parse int(args[0]);
int b=integer parse int(args[1]);
int div=0;
try{
div=a/b;
System.out.println(div); }
catch(Arithmetic Exception e){
printStackTrace();
}
System.out.println(“the race is on”);
}}
Training on java niit (sahil gupta 9068557926)

Training on java niit (sahil gupta 9068557926)

  • 1.
    UNDER THE GUIDENCEOF PRINCE MALHOTRA (Manager)
  • 2.
    Java is ahigh-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows , Mac OS, and the various versions of UNIX. Used in : #Desktop Applications #Web application #robotics #Games #Mobile
  • 3.
  • 8.
    Designing programs usingclasses and objects..Simplify software development and maintenance by providing concepts: #object #class #inheritance #polymorphism #Abstraction #Encapsulation
  • 9.
    Abstraction is aprocess of hiding internal details and showing only functionality to the user.. Ways to achieve abstraction: # Abstract class # Interface abstract class Bike { abstract void run(); } class Honda extends Bike { void run() { System.out.println(“run safely”); } public static void main(String args[]) { Bike obj=new Bike(); obj.run(); }}
  • 10.
    It is amechanism to achieve fully abstraction and multiple inheritance in java... interface Printable { void print(); } interface Showable { void show(); } class A implements Printable,Showable { print void print(){ System.out.println(“hello”); } print void show(){ System.out.println(“Welcome”); } public static void main(String [] args) { A obj= new A(); obj.print() ; obj.show() ; }}
  • 12.
    class Bike { voidrun() { System.out.println(“running ”); } class Splender extends Bike { void run() { System.out.println(“running safely”); } public Static void main(String []args) { Bike obj=new Splender (); obj.run(); }}
  • 13.
    Default Constructor: class B { B(){System.Out.Println(“Welcome”)} public Static void main() { B obj=new B(); }}
  • 15.
    class S { Int id;String name; int age; } S(int i,String n,int a) { name=n; id=i; age=a; } S(int i; String n) { name=n; id=i; } void display(){ System.out.println (id+” ” +name” ”+age) ; } public Static void main(String args[]){ S ob1=new S(111, “ keran”); S obj2=new S(231, “bhanu”, 23); obj1.display(); obj2.display(); }}
  • 16.
    Static property isshared to all objects.. class S { int rollno; String name; Static String college=ITS; }
  • 18.
  • 19.
    class A{ public Staticvoid main(String []args) { int a=integer parse int(args[0]); int b=integer parse int(args[1]); int div=0; try{ div=a/b; System.out.println(div); } catch(Arithmetic Exception e){ printStackTrace(); } System.out.println(“the race is on”); }}