回复 4 楼 汪刚
java事面向对象的吧
package thread_436798_1_1.test097; public class Main { public static void main(String[] args) { String str = "test"; chang(str); System.out.println(str); StringBuffer strBuffer = new StringBuffer("test"); chang_itworks(strBuffer); System.out.println(strBuffer); } public static void chang(String str) { str += "<<"; str += ">>"; } public static void chang_itworks(StringBuffer strBuffer) { strBuffer.append("<<" + ">>"); } }
package thread_436798_1_1.test107; public class Test { public int coutStr(String[] arry, String str) { int count = 0; for (int i = 0; i < arry.length; i++) { if (arry[i].indexOf(str) != -1) count++; } return count; } public static void main(String[] args) { String[] arry = { "happy", "apple", "money", "ending" }; String findStr = "a"; Test test = new Test(); int count = test.coutStr(arry, findStr); System.out.println("此数组中有" + count + "个字符串包含字符" + findStr); } }
package thread_436798_1_1.test108; public class Main { public static void main(String[] args) { char c[] = { '1', '2', '3', '4', '5' }; for (int i = 0; i < c.length / 2; i++) { char d = c[i]; c[i] = c[c.length - (i + 1)]; c[c.length - (i + 1)] = d; } for (int i = 0; i < c.length; i++) { System.out.print(c[i]); } } }
package thread_436798_1_1.test108; public class Reverse { public static void main(String[] args) { StringBuffer string = new StringBuffer("12345"); string.reverse(); System.out.println(string); } }
package thread_436798_1_1.test119; public class Main { public static void main(String[] args) { boolean condition1 = true; boolean condition2 = false; if (condition1) { if (condition2) { System.out.println("在线支付"); } else { System.out.println("货到付款"); } } } }
Sub division() Dim dividend As Integer 'アサウハ dividend = 0 Dim divider As Integer 'ウハ divider = 0 If divider <> 0 And dividend / divider > 1 Then MsgBox "dividend / divider > 1" Else MsgBox "dividend / divider <= 1" End If End Sub
Sub division() Dim dividend As Integer 'アサウハ dividend = 0 Dim divider As Integer 'ウハ divider = 0 If divider <> 0 Then If dividend / divider > 1 Then MsgBox "dividend / divider > 1" Else MsgBox "dividend / divider <= 1" End If Else MsgBox "divider = 0" End If End Sub