spring boot point

spring boot point Java J2EE help for Java technology
spring boot, jpa ,no SQL etc

01/08/2024

API TESTING AND MONITORING TOOLS

01/08/2024

Find even numbers in list

01/08/2024

String permutations

01/08/2024

Find longest substring in the given string

01/08/2024

Find no repeated character in string

31/07/2024

check given string is palindrome : racecar

31/07/2024
31/07/2024

common string-based data structure coding examples in Java that can be useful for interviews:

# # # 1. Reverse a String
```java
public class ReverseString {
public static void main(String[] args) {
String original = "JobSupport24";
String reversed = new StringBuilder(original).reverse().toString();
System.out.println("Reversed String: " + reversed);
}
}
```

# # # 2. Check if a String is a Palindrome
```java
public class PalindromeCheck {
public static void main(String[] args) {
String input = "racecar";
boolean isPalindrome = isPalindrome(input);
System.out.println("Is Palindrome: " + isPalindrome);
}

public static boolean isPalindrome(String s) {
int left = 0, right = s.length() - 1;
while (left < right) {
if (s.charAt(left) != s.charAt(right)) {
return false;
}
left++;
right--;
}
return true;
}
}
```

# # # 3. Find the First Non-Repeated Character
```java
import java.util.LinkedHashMap;
import java.util.Map;

public class FirstNonRepeatedChar {
public static void main(String[] args) {
String input = "swiss";
char firstNonRepeated = firstNonRepeatedCharacter(input);
System.out.println("First Non-Repeated Character: " + firstNonRepeated);
}

public static char firstNonRepeatedCharacter(String s) {
Map charCount = new LinkedHashMap();
for (char c : s.toCharArray()) {
charCount.put(c, charCount.getOrDefault(c, 0) + 1);
}
for (Map.Entry entry : charCount.entrySet()) {
if (entry.getValue() == 1) {
return entry.getKey();
}
}
throw new RuntimeException("No non-repeated character found");
}
}
```

# # # 4. Longest Substring Without Repeating Characters
```java
import java.util.HashSet;
import java.util.Set;

public class LongestSubstringWithoutRepeating {
public static void main(String[] args) {
String input = "abcabcbb";
int length = lengthOfLongestSubstring(input);
System.out.println("Length of Longest Substring Without Repeating Characters: " + length);
}

public static int lengthOfLongestSubstring(String s) {
Set set = new HashSet();
int maxLength = 0, left = 0, right = 0;
while (right < s.length()) {
if (!set.contains(s.charAt(right))) {
set.add(s.charAt(right));
right++;
maxLength = Math.max(maxLength, set.size());
} else {
set.remove(s.charAt(left));
left++;
}
}
return maxLength;
}
}
```

# # # 5. String Permutations
```java
public class StringPermutations {
public static void main(String[] args) {
String input = "ABC";
permute(input, 0, input.length() - 1);
}

public static void permute(String str, int l, int r) {
if (l == r) {
System.out.println(str);
} else {
for (int i = l; i

1. Fix your schedule and sleep at 9.00 PM to be awake at 4.00 AM.2. Quit your excuses and work out for 30-minutes daily....
02/06/2024

1. Fix your schedule and sleep at 9.00 PM to be awake at 4.00 AM.

2. Quit your excuses and work out for 30-minutes daily.

3. Include fresh fruits in your daily diet to optimize your health.

4. Prioritize cold shower in a day with no excuses. I promise your self discipline will be boosted.

5. Listen more than you talk and be teachable.6. Learn to say "NO" unapologetically and get busy minding your own business.

7. Make an attempt and read 50+ pages to sharpen your mind.

8.Learn a new skill every 3 months and spend another 90 days developing it.

9. Set on a monitoring walk after having 2 glasses of water immediately after sleep.10. Sleep a quarter of your day to reset your focus and boost your mood.

11. Meditation creates a space between feeling an impulse and acting on it.

12. Please for no one else, do something for yourself for 6 months.

13. Go for 1,000 hours without watching news or talking politics and use the to rest.

14. Make more money, and invest wisely to buy yourself anything without looking at the price.

15. Prioritize 4 hours of deep work a day over 8+ hours of business and make time to improve yourself.

16. Make time for your close friends and family during your weekend.

java-roadmap
15/04/2024

java-roadmap

Address

Financial District
Hyderabad
500032

Telephone

+919182662482

Website

https://www.rbuacadamy.com/

Alerts

Be the first to know and let us send you an email when spring boot point posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Business

Send a message to spring boot point:

Share