Skip to main content

Posts

Showing posts from December, 2015

Interface in Java

Interface:          An interface is a nothing but  reference type,it is same as class.In short Interface is collection of Abstract Method .          It can  also contain  final, static fields  .               you can't create object of Interface.    it can't have Constructor.   Interface can't implement another interface it can extend another one. Interface not extended by class but implemented. Declare Interface: public interface Example {     // final, static fields  .     //Method } Example 1.create interface that contain method. public interface IA {     public void show(); } 2.implement by class  public class ClassA  implements IA{     @Override     public void show() {         System.out.println("from class A called");   ...

Factory Pattern

Factory Pattern        Factory Pattern is way to create object in such Way using Common Interface  without exposing the creation logic Simple Example       Example: step  1.  creation of interface.     public interface BANK {        double getIntrest();   } step  2.  implementation of interface for BOB. public class BOB implements BANK {     @Override     public double getIntrest() {         return 8.7;     } } step 3.  implementation of interface for SBI . public class SBI implements BANK{     @Override     public double getIntrest() {         return 5.7;     }      } step 4.  implementation of interface for UNION  . public class UNION  implements BANK{     ...

JAVA

Java Java is a   platform and   programming language. Simple Basic Java Program Structure.     public  class Example      {          System.out.println("Hello Java Programer");      } Java Applications: java Provide Folwing Type of Application\ 1.Standalone 2.Enterprise 3.Web 4.Mobile

Java OOP Concepts

Java OOP Concepts Java OOP Concepts:       Java is not fully Object Oriented Programing Languages Because java Provide Primitive Data types Like int,string etc.             Java Provide Following OOPS: Object Class  Inheritance  Polymorphism Abstraction  Encapsulation 1.Object    -Object is nothing but just Blueprint Of Class Means it contain Properties And Behaviour Of Class.     example: real time Example is People, pen. 2.Class   -Class Contain Methods and Properties. so we can say that Collection of Object is nothing But Class. 3.Inheritance   -Inheritance is Process  or Scenario  for accessing Parent class Properties .Means access Properties and Method of Parent class into Sub Class. 4.Polymorphism    -In simple Word Polymorphism is way to Perform one Task in Multiple Dif...

Introduction

What is java?   Java is Programming language developed by sun micro system in 1991.  It is current “Hot ” language and almost object oriented.  It has Vast  Library  of Predefined  Objects and Operation and for running java code require Development tool kit. Why Java Different than Other Languages. -Java Provide Some future which is Different than other Languages. 1.Java is  simple Java is simple because   syntax of java is same as C and C++. Programmer who familiar with c and  c++  will have much easy to learn java Languages. Also provide automatic Memory management so no need to Write Code For That. 2. Java is  Protable. There are no implementation-dependent aspects of the language specifications. For example, the sizes of primitive data types and the behavior of the arithmetic on them are specified. This contributes to making programs portable among different platform...