This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package interviews; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
public class CopyArray { | |
public static void main(String args[]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.app.interviews; | |
public class LongestWord { | |
public static void main(String[] args) { | |
String s = "Hi, May I know your name please? "; | |
String[] array = s.split(" "); | |
String rts = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.app.interviews; | |
public class SwapNumber { | |
public static void main(String args[]) { | |
int x = 10; | |
int y = 20; | |
x = x + y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.app.interviews; | |
public class CommonElements { | |
public static void main(String args[]) { | |
int[] a = {1, 2, 3, 4, 5}; | |
int[] b = {2, 3, 4, 5, 6, 7, 8}; | |
for (int i = 0; i < a.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.app.entity; | |
import com.fasterxml.jackson.annotation.JsonManagedReference; | |
import lombok.Data; | |
import lombok.EqualsAndHashCode; | |
import javax.persistence.*; | |
import java.io.Serializable; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
public class CheckUsername { | |
public static void main(String args[]) throws IOException { | |
new CheckUsername().checkUsername("user1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.net.URLEncoder; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
public class GetToken { | |
public static void main(String[] args) throws IOException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.Gson; | |
import java.io.*; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.util.ArrayList; | |
public class CreateNewUser implements Serializable { | |
public static void main(String args[]) throws IOException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.app.demo.controller; | |
import com.app.demo.model.*; | |
import com.app.demo.service.ApiService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.List; | |
@RestController | |
@RequestMapping("/api/v2/users/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.app.eyepax; | |
public class Constants { | |
public static final Integer N = 1; | |
public static final Integer E = 2; | |
public static final Integer S = 3; | |
public static final Integer W = 4; | |
} |