Posts

Showing posts from February, 2013

JAXB -Play With XML

Image
JAXB  -Play With XML    (A Simple Example With Explanation)                     JAXB stands for Java Architecture For XML binding.Using this we can Write and Read An XML File .Unlike SAX,DOM no need to have much knowledge on xml parsing . JAXB is  a very easy technique to understand Writing an XML file is called as marshaling Reading an XML file is called as unmarshaling         Let us see the step by step procedure to perform marshaling & un marshaling.          Marshaling  As Mentioned above marshal ing means writing xml fil e form java object. The first step i s creating  java class from a sc he ma.if we have a schema file required we can create pojo cl assess from it using xsd jar. xsd ja r is ava ilable with java by default .xsd is a binding comp iler which is mentioned in the diagram. create a java p roject in eclispe IDE create a new xsd file insi de the projec t.   Right click on the project new - Xml schema    

The Keyword "super"

                                                                                                      The Keyword "super" Consider we are extending a class from another class using inheritance , we always create an object to a sub class..this is because we can access all super class and sub class  members using sub class object.If super class and sub class members have same name by default only sub class members are accessible.. In this case we can use Super Keyword to access super class member. Example1:         Class Mysuper {  int i=10; void show() { System.out.println("super class variable:i="+i); } } Class Mysub extends  Mysuper { int i=20; void show() { System.out.println("sub class variable:i="+i); } } Class TestSuper { public static void main(String args[]) Mysub m=new Mysub(); m.show(); } This will give the  following output: sub class variable:i=20 So if i want to access the variab