Convert XML In To Java Using Java

package com.java.basicprograms;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

public class ConvertXMLInToJava {

public static void main(String[] args) {
try {
JAXBContext context  = JAXBContext.newInstance(Item.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
File file = new File("E:/item.xml");
Item item = (Item) unmarshaller.unmarshal(file);
System.out.println(item);


} catch (JAXBException e) {

e.printStackTrace();
}


}

}

Comments

Popular posts from this blog

WebPage Design Using HTML and CSS

How to design webpage using HTML And CSS