1. Introduction
In this article, You'll learn how to convert kotlin stack trace to a String programmatically.
This is part of the Kotlin Program Series
Java Tutorials for Freshers and Experience developers, Programming interview Questions, Data Structure and Algorithms interview Programs, Kotlin programs, String Programs, Java 8 Stream API, Spring Boot and Troubleshooting common issues.
[class OrderInfo{
@Bean
public Customer getCustomer(){
return new Customer();
}
}]
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
@GetMapping("/error") public String getDefaultPage(@RequestHeader(name = "errorcode") String errorCode) { logger.info("error code : " + errorCode); return "error"; }
spring.data.rest.basePath=/api/v1
server.servlet.context-path=/api/v1
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.6.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.javaprogram</groupId> <artifactId>spring-boot-app</artifactId> <version>0.0.1-SNAPSHOT</version> <name>spring-boot-app</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
Coronavirus is spreading very fastly worldwide in all countries. It is first started in China that changing the world's future now badly. Now India also started seeing Corona cases. Now India has reached 3052 and more growing rapidly but not entered into third stage. One common point is all corona patients are returned from different countries mainly from Italy, Italy, and Spain.
// Adding 10 mins using Date constructor. Calendar date = Calendar.getInstance(); System.out.println("Current Date and TIme : " + date.getTime()); long timeInSecs = date.getTimeInMillis(); Date afterAdding10Mins = new Date(timeInSecs + (10 * 60 * 1000)); System.out.println("After adding 10 mins : " + afterAdding10Mins);
Current Date and TIme : Wed Apr 08 21:53:45 IST 2020 After adding 10 mins : Wed Apr 08 22:03:45 IST 2020
LinkedHashMap is used to store the key-value pairs as similar to the HashMap. But, LinkedHashMap extends HashMap and AbstractMap implements Map interface. The main advantage of LinkedHashMap is it preserves the insertion order that meanwhile iterating it pull the Entry Objects how the order keys are inserted into LinkedHashMap.
createNewFile() createTempFile()