ok, will we begin to calculate how many value of String?
First, we must write the coding, like this :
Are you need explanation about that? If you needed, i can tell for you.
if you look this code like :
/**
.......
.......
**/
that is not code to command code of java, but to write about explanation only.
And after that, we will import the GUI to looked, we write like this :
import javax.swing.JOptionPane;
Now, we begin to create class name "homework", and object "a" as value of string etc.
public class homework{ /** tell you how do you create a class **/
public static void main(String[] args){ /** tell you how do you run the program **/
String a; /** tell you how do you create a object with name 'a' **/
a=JOptionPane.showInputDialog("insert your string : "); /** tell you how do you create declaration a variable **/
JOptionPane.showMessageDialog(null,"How many your string = "+a.length()); /** tell you to print about value**/
}
}
after that, you can run by F5 or other agree with application. and if you will be look like this :
insert your text, and click ok. and you will be look like this :
ok.. Finish..
please, give me command about that.
0 komentar