Java Programming Java Code Samples



Filters


Deduplicate a string in java
harika | 6 years, 2 months
import java.util.HashMap;
public class DeduplicationOfString{
        static String dedup(String i
java string
ashokrebel007
8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE
ashokrebel007 | 5 years, 9 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
srija
While opening eclipse getting java virtual machine not found error
srija | 5 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 | 5 years, 2 months
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 | 5 years, 2 months
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.fac
application.properties java @value
How to read a file from nth line onwards in java?
Reshma | 4 years, 11 months
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
reading nth line onwards java
Reading application.Properties with @ConfigurationProperties
Reshma | 5 years, 2 months
//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
Comments executed
Reshma | 5 years, 4 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 | 5 years, 3 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 | 5 years, 4 months
class Fibonacci { 
    static int fib(int n) 
    { 
java fibonacci
Next