w3schools編寫Java程式語言
微軟VS Code編寫Java程式語言
Java程式語言
public class Main {/*劉任昌w3schools內建方法length,charAt*/
public static void main(String[] args) {
String a = "狗吃大便,貓抓鼠";
String b = ""; /*字串b初始值是空的*/
int c = a.length(); /*方法 length() 得到字串長度*/
System.out.println("原來字串: " + a);
System.out.println("字串長度: " + c);
for (int i = 0; i < c; i++)
b = a.charAt(i) + b; /*方法charAt()得到該位置的字元*/
System.out.println("反向字串: "+ b);
}
}
下次上課Java程式語言
import java.util.Scanner; // Import the Scanner class
class MyClass {
public static void main(String[] args) {
String a, b="";
Scanner myObj = new Scanner(System.in); // Create a Scanner object
System.out.print("輸入: ");
a = myObj.nextLine(); // Read user input
for (int i = 0; i < a.length(); i++)
b = a.charAt(i) + b;
System.out.println("輸出: "+ b);
}
}
https://cindy-javascript.blogspot.com/2022/12/blog-post_22.html
回覆刪除https://xdrcfvghyujiok8945656.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://tgyhjikolujik2554.blogspot.com/2022/12/blog-post_22.html
回覆刪除https://iuytjhg5261.blogspot.com/2022/12/blog-post_22.html
回覆刪除https://www.blogger.com/blog/post/edit/8816069461855785316/4141137867077338132
回覆刪除https://rtytrdtfg.blogspot.com/2022/12/javalengthchatat.html
回覆刪除https://yuzcc28.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://lihtml-css-javascript-java.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://www.blogger.com/blog/post/edit/5444106583314177344/692679455548677204
回覆刪除https://unnnn20.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://d11150116.blogspot.com/2022/12/javalengthchatat.html
回覆刪除https://wxxx17.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://d11150110.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://d11150108.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://d11150114.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://d11150115.blogspot.com/2022/12/javalengthcharat.html
回覆刪除作者已經移除這則留言。
回覆刪除https://d11150112.blogspot.com/2022/12/blog-post_22.html
回覆刪除https://danny1219.blogspot.com/2022/12/public-class-main-w3schools.html
回覆刪除https://www.blogger.com/blog/post/edit/4875050941750982933/7717410886791635101
回覆刪除https://xylia-lin.blogspot.com/2022/12/javalengthvs-code.html
回覆刪除https://jia-yi-lin.blogspot.com/2022/12/javalengthcharatvs-code.html
回覆刪除https://eric-young92.blogspot.com/2022/12/javalengthcharat.html
回覆刪除https://www.blogger.com/blog/post/edit/preview/2906555295508746076/3807910884841986512
回覆刪除https://hsiehyuche.blogspot.com/2022/12/javalengthcharatexcellen.html
回覆刪除作者已經移除這則留言。
回覆刪除作者已經移除這則留言。
回覆刪除