1 2 3 4 5 6 7 8 9
o/p
4 3 2 1 5 6 7 8 9
public class Application {
public static void main(String[] args) {
Integer[] x = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int length = x.length;
int pos = 4;
int temp;
for (int i = 0; i < length — 1; i++)
System.out.print(x[i] + “ “);
for (int i = 0; i < pos / 2; i++) {
temp = x[i];
x[i] = x[pos — i — 1];
x[pos — i — 1] = temp;}
System.out.println();
for (int i = 0; i < length — 1; i++)
System.out.print(x[i] + “ “);}}O/p
1 2 3 4 5 6 7 8 9
4 3 2 1 5 6 7 8 9
Reading and Writing Object Using ObjectMapper
We can use it to parse or deserialize JSON content into a Java object.
Java Object to JSON
ObjectMapper objectMapper = new ObjectMapper(); Car car = new Car(“yellow”, “renault”); objectMapper.writeValue(new File(“target/car.json”), car);
JSON to Java Object
String json = "{ \"color\" : \"Black\", \"type\" : \"BMW\" }";
Car car = objectMapper.readValue(json, Car.class);
The readValue() function also accepts other forms of input, such as a file containing JSON string:
Car car = objectMapper.readValue(new File("src/test/resources/json_car.json"), Car.class);
Transaction simply represents a unit of work ,In such case, if one step fails, the whole transaction fails.
Hibernate Transaction Management
Transaction simply represents a unit of work ,In such case, if one step fails, the whole transaction fails.
Transaction is a Interface in Hibernate
- The methods of Transaction interface are as follows:
* void begin() starts a new transaction.
* void commit() ends the unit of work unless we are in FlushMode.NEVER.
*…
download Lombok jar
https://projectlombok.org/download
Goto lombok jar download location and run command
java -jar lombok-1.16.18.jar
Give Lombok Install Path
click on the “Specify Location” button and locate the eclipse.exe


Step 1: Generate Your SSH Key
ssh-keygen -t rsa -b 4096 -C “youreamil@example.com”
SSH Key on Windows
$ eval $(ssh-agent -s)
$ ssh-add ~/.ssh/id_rsa
Step 3: Add the SSH Key on GitHub
clip < ~/.ssh/id_rsa.pub
step 4 add ssh key in github/gitlab