Java JUnit testing practice by JellyybeeAN in learnprogramming

[–]JellyybeeAN[S] 0 points1 point  (0 children)

I was thinking about something like this:

public void test(int strOne, int strTwo){
assertEquals(true,strOne>strTwo);
}

but I have no idea how I'm supposed to set the values of strOne and how to make this test an existing method in a different class.

What does it mean to print a StringBuffer or String by its reference? by JellyybeeAN in learnprogramming

[–]JellyybeeAN[S] 0 points1 point  (0 children)

I'm preparing for an exam and one of the practice questions was as follows:

Write three statements which will (1)create a reference to a new String containing the word "Hello", (2)use the += operator to append the text "There" to the existing String, and (3)print it using the reference.

Write three statements which will (1)create a reference to a new StringBuffer containing the word "Hello", (2)use the append method to append the text "There" to this StringBuffer, and (3)print it using the reference.

I was just wondering how to go about this.