Skip to main content
Code Review

Return to Question

Commonmark migration
Source Link

Write a Java method that accepts two strings as parameters and returns a string that contains all unique two-character strings whose first character comes from the first string and second character comes from the second string. All two-character strings in your returned string should be separated by a space. Use ordinary string concatenation in your solution. Look at the examples below for a "hint" on how to proceed and look at the String API for methods you can use to simplify your solution.

Example

First string = ABCD
Second string = EFGH
Returned string > AE AF AG AH BE BF BG BH CE CF CG CH DE DF DG DH

Write a Java method that accepts two strings as parameters and returns a string that contains all unique two-character strings whose first character comes from the first string and second character comes from the second string. All two-character strings in your returned string should be separated by a space. Use ordinary string concatenation in your solution. Look at the examples below for a "hint" on how to proceed and look at the String API for methods you can use to simplify your solution.

Example

First string = ABCD
Second string = EFGH
Returned string > AE AF AG AH BE BF BG BH CE CF CG CH DE DF DG DH

Write a Java method that accepts two strings as parameters and returns a string that contains all unique two-character strings whose first character comes from the first string and second character comes from the second string. All two-character strings in your returned string should be separated by a space. Use ordinary string concatenation in your solution. Look at the examples below for a "hint" on how to proceed and look at the String API for methods you can use to simplify your solution.

Example

First string = ABCD
Second string = EFGH
Returned string > AE AF AG AH BE BF BG BH CE CF CG CH DE DF DG DH

Tweeted twitter.com/#!/StackCodeReview/status/602383862489034752
deleted 69 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Constructing Unique String Sequence - Java Assignment

I am brushing up on my Java skills by trying to solve the below assignment problem I found on the internet - Sourcethe below assignment problem I found on the internet :

How can I came up with the following workingimprove this code?

How can I improve the above code ? Thank you.

Constructing Unique String Sequence - Java Assignment

I am brushing up my Java skills by trying to solve the below assignment problem I found on the internet - Source

I came up with the following working code

How can I improve the above code ? Thank you.

Constructing Unique String Sequence

I am brushing up on my Java skills by trying to solve the below assignment problem I found on the internet :

How can I improve this code?

removed identical 2nd example
Source Link
janos
  • 113k
  • 15
  • 154
  • 396

First string = ABCD
Second string = EFGH
Returned string > AE AF AG AH BE BF BG BH CE CF CG CH DE DF DG DH

First string = ABCD
Second string = EFGH
Returned string > AE AF AG AH BE BF BG BH CE CF CG CH DE DF DG DH

Source Link
Loading
lang-java

AltStyle によって変換されたページ (->オリジナル) /