<< Chapter < Page Chapter >> Page >

What you can expect

This book will explain how to use the following classes:

  • JSONObject
  • JSONValue
  • JSONParser
  • JSONArray
  • ParseException

An investigation into the use of the other classes and interfaces will be left as "an exercise for the student" .

Run the program

I encourage you to copy the code from Listing 1 . Execute the code and confirm that you get the same results as those shown in Figure 1 . Experiment with the code, making changes, and observing the results of your changes. Make certain that youcan explain why your changes behave as they do.

Complete program listing

Listing 1 provides the source code for the program named Code.java .

Listing 1 . Program named Code.java. /******************************************************************** Copyright 2016, R.G.BaldwinEstablishes the position of each of the json-simple classes in the class hierarchy by getting and displaying the superclass of eachclass. Produces the following output:ItemList: class java.lang.Object JSONArray: class java.util.ArrayListJSONObject: class java.util.HashMap JSONParser: class java.lang.ObjectJSONValue: class java.lang.Object ParseException: class java.lang.ExceptionYytoken: class java.lang.Object Tested with Java 8, Windows 7, and json-simple-1.1.1.jar********************************************************************/ import org.json.simple.JSONObject;import org.json.simple.JSONArray; import org.json.simple.JSONValue;import org.json.simple.ItemList; import org.json.simple.JSONAware;import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException;import org.json.simple.parser.Yytoken; class Code{public static void main(String[] args){System.out.println("ItemList: " + new ItemList().getClass().getSuperclass());System.out.println("JSONArray: " + new JSONArray().getClass().getSuperclass());System.out.println("JSONObject: " + new JSONObject().getClass().getSuperclass());System.out.println("JSONParser: " + new JSONParser().getClass().getSuperclass());System.out.println("JSONValue: " + new JSONValue().getClass().getSuperclass());System.out.println("ParseException: " + new ParseException(ParseException.ERROR_UNEXPECTED_CHAR).getClass().getSuperclass()); System.out.println("Yytoken: " +new Yytoken(Yytoken.TYPE_COLON,":"). getClass().getSuperclass());}//end main }//end class code


This section contains a variety of miscellaneous information.

Housekeeping material
  • Module name: Json0210: Structure of the json-simple JavaLibrary
  • File: Json0210.htm
  • Published: 05/30/16

Financial : Although the Connexions site makes it possible for you to download a PDF file for thismodule at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should beaware that some of the HTML elements in this module may not translate well into PDF.

I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version of the module.

In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale on Amazon.com showing me as the author. Ineither receive compensation for those sales nor do I know who does receive compensation. If you purchase such a book, please beaware that it is a copy of a module that is freely available on cnx.org and that it was made and published withoutmy prior knowledge.

Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.


Questions & Answers

how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Do somebody tell me a best nano engineering book for beginners?
s. Reply
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
many many of nanotubes
what is the k.e before it land
what is the function of carbon nanotubes?
I'm interested in nanotube
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
what is system testing
what is the application of nanotechnology?
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
anybody can imagine what will be happen after 100 years from now in nano tech world
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
silver nanoparticles could handle the job?
not now but maybe in future only AgNP maybe any other nanomaterials
I'm interested in Nanotube
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
can nanotechnology change the direction of the face of the world
Prasenjit Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Berger describes sociologists as concerned with
Mueller Reply
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Object-oriented programming (oop) with java. OpenStax CNX. Jun 29, 2016 Download for free at https://legacy.cnx.org/content/col11441/1.201
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?