Language: C

package com.degree45;

import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.net.*;
import java.util.*;

import org.dom4j.*;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.*;

public class XML_Account {
	
	private Document doc;
	private String url;
	
	public XML_Account(String u) {
		// TODO Auto-generated constructor stub
		url=u;
		try {
			doc = getDoc(url);
		} catch (DocumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public Document getDoc(String url) throws DocumentException{
		SAXReader reader = new SAXReader();
		Document document = reader.read(url);
		return document;
	}
	
	public void bar(Document doc) {
		Element root = doc.getRootElement();
		System.out.println("root: "+root.getName());
		for(Iterator i=root.elementIterator();i.hasNext();){
			 Element element = (Element) i.next();
			 String name = element.elementText("username");
			 String pass = element.elementText("password");
			 System.out.println(element.getName()+","+name+","+pass);
		}
	}
	
	public boolean findAccount(int kind,String name,String passwd){
		Element root = doc.getRootElement();
		for(Iterator i=root.elementIterator();i.hasNext();){
			Element element=(Element)i.next();
			if(element.elementText("username").equals(name)){
				if(kind==0) {
					if(element.elementText("password").equals(passwd)) return true;
					return false;
				}
				else if(kind==1){
					return true;
				}
			}
		}
		return false;
	}
	
	public void addAccount(String name,String passwd){
		
		Element root = doc.getRootElement();
		Element e = root.addElement("account");
		e.addElement("username").addText(name);
		e.addElement("password").addText(passwd);
		
		try {
			XMLWriter writer;
			writer = new XMLWriter(new FileWriter( url ));
			writer.write( doc );
			writer.close();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		XML_Account xa = new XML_Account("./WebRoot/WEB-INF/Accounts/BlackAccounts.xml");
		System.out.println("---> "+xa.findAccount(1,"bigming","123"));
		xa.bar(xa.doc);
		System.out.println("All Right");
	}

}

Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package com.degree45;
      | ^~~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | package com.degree45;
      |            ^
main.c:3:1: error: unknown type name 'import'
    3 | import java.io.FileOutputStream;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.io.FileOutputStream;
      |            ^
main.c:4:1: error: unknown type name 'import'
    4 | import java.io.FileWriter;
      | ^~~~~~
main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | import java.io.FileWriter;
      |            ^
main.c:5:1: error: unknown type name 'import'
    5 | import java.io.IOException;
      | ^~~~~~
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | import java.io.IOException;
      |            ^
main.c:6:1: error: unknown type name 'import'
    6 | import java.net.*;
      | ^~~~~~
main.c:6:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    6 | import java.net.*;
      |            ^
main.c:7:1: error: unknown type name 'import'
    7 | import java.util.*;
      | ^~~~~~
main.c:7:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    7 | import java.util.*;
      |            ^
main.c:9:1: error: unknown type name 'import'
    9 | import org.dom4j.*;
      | ^~~~~~
main.c:9:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    9 | import org.dom4j.*;
      |           ^
main.c:10:1: error: unknown type name 'import'
   10 | import org.dom4j.io.OutputFormat;
      | ^~~~~~
main.c:10:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   10 | import org.dom4j.io.OutputFormat;
      |           ^
main.c:11:1: error: unknown type name 'import'
   11 | import org.dom4j.io.SAXReader;
      | ^~~~~~
main.c:11:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   11 | import org.dom4j.io.SAXReader;
      |           ^
main.c:12:1: error: unknown type name 'import'
   12 | import org.dom4j.io.*;
      | ^~~~~~
main.c:12:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   12 | import org.dom4j.io.*;
      |           ^
main.c:14:1: error: unknown type name 'public'
   14 | public class XML_Account {
      | ^~~~~~
main.c:14:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'XML_Account'
   14 | public class XML_Account {
      |              ^~~~~~~~~~~