JSOn-Simple-101 Flashcards

1
Q

What basically JSOn Simple uses internally to store the data?

A

Map & List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the full package ?

A

org.json.simple.*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the core object class?

A

JSONObject

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is official toString method?

A

toJSONString()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What we should use to write the json keys?

A

JSONArray

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is JSONArray differs itself with simple arrays?

A

With JSONArray you can have only keys to come or Full JSONObject or Object to come in. need not to explicitly say the Type casting as we do in Array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Say one e.g. for Put in JSONObejct with JSOnArray

A
JSONObject obj = new JSONObject();
obj.put(key, new Object());
JSONArray arr= new JSONArray();
arr.add("key1");

obj.put(“jkey”, arr);

So , put for JSONObject and add for JSONArray

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is @SuppressWarnings(“unchecked”)

A
This is eclispe warning, as it generally applies where the class doesnot support generics. 
Like JSONObject  doesnot support generics
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does JSONObejct extends ?

A

extends HashMap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which class will do the job of Parsing?

A

JSONParser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the method that will do the parsing in JSONParser and what it takes in?

A

parse
JSONParser parser = new JSONParser()
parser.parse(takes anyting that ultimately gives a String)

like Reader orString or Stream*

Explicit casting is required as it gives an Object

For Array better to use JSONArray

How well did you know this?
1
Not at all
2
3
4
5
Perfectly