Posts

How to write json objects into the file using java language?

Image
Java read json file The JSON is one of the broadly utilized information exchange designs and is a lightweight and language free.   The json.simple is a lightweight JSON handling library that can be utilized to peruse and compose JSON records and it tends to be utilized to encode or disentangle JSON message and completely consistent with JSON determination.   To peruse a JSON record, we really want to download the json-simple.jar document and set the way to execute it . //code import java.io.*; import java.util.*; import org.json.simple.*; import org.json.simple.parser.*; public class Example1 {    public static void main(String[] args) {       JsonFile parser1 = new JsonFile();       try {          Object obj1 = parser.parse(new FileReader1("/Bhoomika/Victus/Desktop/course.json"));          jsonObject = (JsonOb...

Python Random Module

  Python Random Module Python contains many files that can be imported into a python code and used whenever we want. One of those modules is the random module. It is a good practice to know about the modules in python . This module is used to generate random numbers in python. Whenever we write a code and want to generate a random number in our code, then we use the random module in python. Using the Python random module The random module is an in-built module in python. It generates pseudo-random numbers that are not exactly random but seem that way.   This can be used in many ways as generating random values, printing random values, selecting a random index in an array, etc. Before using this module, we have to import it first. We can import the random module using the import statement. import random As we already know from the above paragraph, that random module gives pseudo-random numbers, which means that the number is not random. They depend on the seeding ...