You can do it in one line if you are fine with using an open source library or you can do it in a couple of lines of code in core Java as well. But this post is about a new library called jcabi-xml which makes working with XML file really easy. I was playing with this new XML library and thought to share a couple of examples of XML processing to show how powerful it is. By the way, while reading XML file as String one thing you must remember is character encoding, which is specified in the header of an XML file.
History[ edit ] Mount Sumbing surrounded by rice fields. Java's volcanic topography and rich agricultural lands are the fundamental factors in its history. Fossilised remains of Homo erectuspopularly known as the " Java Man ", dating back 1.
Out of these village alliances, small kingdoms developed. The chain of volcanic mountains and associated highlands running the length of Java kept its interior regions and peoples separate and relatively isolated.
Only the Brantas and Sala rivers could provide long-distance communication, and this way their valleys supported the centres of major kingdoms. A system of roads, permanent bridges and toll gates is thought to have been established in Java by at least the midth century.
Local powers could disrupt the routes as could the wet season and road use was highly dependent on constant maintenance. Subsequently, communication between Java's population was difficult.
Medang's religion centred on the Hindu god Shivaand the kingdom produced some of Java's earliest Hindu temples on the Dieng Plateau.
Around the 8th century the Sailendra dynasty rose in Kedu Plain and become the patron of Mahayana Buddhism. This ancient kingdom built monuments such as the 9th century Borobudur and Prambanan in central Java.
Around the 10th century the centre of power shifted from central to eastern Java. The eastern Javanese kingdoms of KediriSinghasari and Majapahit were mainly dependent on rice agriculture, yet also pursued trade within the Indonesian archipelago, and with China and India.
Majapahit was established by Wijaya : Hayam Wuruk's prime minister, Gajah Madaled many of the kingdom's territorial conquests. During this era, the Islamic kingdoms of DemakCirebonand Banten were ascendant.
The Mataram Sultanate became the dominant power of central and eastern Java at the end of the 16th century. The principalities of Surabaya and Cirebon were eventually subjugated such that only Mataram and Banten were left to face the Dutch in the 17th century.
Colonial periods[ edit ] Tea plantation in Java during Dutch colonial periodin or before Java's contact with the European colonial powers began in with a treaty between the Sunda kingdom and the Portuguese in Malacca. After its failure the Portuguese presence was confined to Malacca, and to the eastern islands.
Ina four-ship expedition led by Cornelis de Houtman was the first Dutch contact with Indonesia. Internal conflict prevented the Javanese from forming effective alliances against the Dutch.
Remnants of the Mataram survived as the Surakarta Solo and Yogyakarta principalities. Javanese kings claimed to rule with divine authority and the Dutch helped them to preserve remnants of a Javanese aristocracy by confirming them as regents or district officials within the colonial administration.
Java's major role during the early part of the colonial period was as a producer of rice. In spice producing islands like Bandarice was regularly imported from Java, to supply the deficiency in means of subsistence.
During the short-lived Daendels administration, as French proxy rule on Java, the construction of the Java Great Post Road was commenced in The road, spanning from Anyer in Western Java to Panarukan in East Java, served as a military supply route and was used in defending Java from British invasion.
InJava was returned to the Dutch under the terms of the Treaty of Paris. Factors for the great population growth include the impact of Dutch colonial rule including the imposed end to civil war in Java, the increase in the area under rice cultivation, and the introduction of food plants such as casava and maize that could sustain populations that could not afford rice.
There were no significant famines in Java from the s through to the Japanese occupation in the s. Furthermore, the age of first marriage dropped during the 19th century thus increasing a woman's child bearing years.Apache POI is a powerful Java library to work with different Microsoft Office file formats such as Excel, Power point, Visio, MS Word etc.
The name POI was originally an acronym for Poor Obfuscation Implementation, referring humorously to the fact that the file formats seemed to be deliberately obfuscated, but poorly, since they were successfully reverse .
That's all about how to read and write Excel file in Java. We have learned to read/write both XLS and XLSX format in Java, which is key to support old Microsoft Excel files created using Microsoft Office version prior to Though there are couple of other alternative libraries to read Excel files from Java program, but Apache POI is the best one and you should use it whenever possible.
Java is defined by a specification and consists of a programming language, a compiler, core libraries and a runtime (Java virtual machine) The Java runtime allows software developers to write program code in other languages than the Java programming language which still runs on the Java virtual machine.
Java provides several ways to write to file. We can use FileWriter, BufferedWriter, java 7 Files and FileOutputStream to write file in Java. Java Write to File.
I want to write an ArrayList into a text file. The ArrayList is created with the code: ArrayList arr = new ArrayList(); StringTokenizer st = new StringTokenizer(line, ":Mode. Reading text file into arraylist. Ask Question. either by using Scanner or by using BufferedReader then reading a text file into ArrayList is not difficult for you.
All you need to do is read each line and store that into ArrayList, as shown in following example: How do I save a String to a text file using Java? How to avoid Java.