Java Code Samples



Filters


Deduplicate a string in java
harika | 5 years, 6 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, 1 month
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 | 4 years, 7 months
First we have to check is java successfully installed or not check using below command
java -versio
java eclipse
How to read a file from nth line onwards in java?
Reshma | 4 years, 3 months
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
reading nth line onwards java
Reading application.properties with @Value Annotation
Reshma | 4 years, 6 months
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.fac
application.properties java @value
Read application.properties Using the Environment
Reshma | 4 years, 6 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 @ConfigurationProperties
Reshma | 4 years, 6 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 | 4 years, 8 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 | 4 years, 7 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
Overloading In Java
Reshma | 4 years, 8 months
public class Sum
{ 
    public int sum(int x, int y) 
java overloading
Next