/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package seninalgo;
import javax.swing.JOptionPane;
/**
*
* @author DOA
*/
public class ContohFor {
public static void main(String[] args) {
String input = JOptionPane.showInputDialog("Masukkan Sebuah Kalimat?");
String [] kalimat = input.split("");
String kalimatbaru="";
for(int i=kalimat.length-1;i!=-1;i--){
kalimatbaru=kalimatbaru+kalimat[i]+" ";
}
JOptionPane.showMessageDialog(null, kalimatbaru);
}
}
- Home Unlabelled Membalik Bacaan / Kalimat Dengan For Loop (Java Code)







No comments:
Post a Comment