Java Code Samples



Filters


ashokrebel007
8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE
ashokrebel007 | 6 years, 8 months
Open CMD with Administrator

1. Check what processes are running at available ports
If you want do this one you should open the CMD with Administrator only.
java
Deduplicate a string in java
harika | 7 years, 1 month
import java.util.HashMap;
public class DeduplicationOfString{
        static String dedup(String i
java string
srija
While opening eclipse getting java virtual machine not found error
srija | 6 years, 3 months
First we have to check is java successfully installed or not check using below command
java -versio
java eclipse
Read application.properties Using the Environment
Reshma | 6 years, 1 month
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.
Here, we are using @Autowired annotation to inject the environment object into our RestController ,
java application.properties environment
Reading application.properties with @Value Annotation
Reshma | 6 years, 1 month
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.fac
application.properties java @value
Reading application.Properties with @ConfigurationProperties
Reshma | 6 years, 1 month
//AppProperties.java

import org.springframework.boot.context.properties.ConfigurationProperties;
To use AppProperties.java we have to create a Controller or Service class.In order to include it we
application.properties java @configurationproperties
How to read a file from nth line onwards in java?
Reshma | 5 years, 10 months
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
reading nth line onwards java
Comments executed
Reshma | 6 years, 3 months
public class Testing { 
    public static void main(String[] args) 
     { 
The reason for this is that the Java compiler parses the unicode character \u000d as a new line and
java comments
Finding anagram
itulasi | 6 years, 2 months
import java.util.Arrays;

public class StringAnagram {
Anagram of the string is a string contains the same characters. But order of the characters may be d
java string anagram
Fibonacci Series in java
Reshma | 6 years, 3 months
class Fibonacci { 
    static int fib(int n) 
    { 
java fibonacci
Next