class StringToChar{ public static void main(String args[]){ String str = new String("HELLO HOW ARE YOU"); char ch[] = new char[str.length()]; for(int i=0;iDiscussion
In above code sample we have used str.length() where length() is a function but for array length we use array.length where length is property.