package experience3;
import java.util.*;
public class part3 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
char[]c1= {'a','b','v'};
int k=123;
MyString1 c=new MyString1(c1);
System.out.println(c.length());
System.out.println(c.charAt(0));
System.out.println(c.get());
c=MyString1.valueOf(k);
System.out.println(c.get());
}
}
class MyString1{
private char [] c1;
public MyString1(){
}
public MyString1(char [] chars) {
c1=chars;
}
public int length() {
int i=0;
for(char e:c1) {
i++;
}
return i;
}
public char charAt(int index) {
return c1[index];
}
public MyString1 substring(int begin,int end) {
int i,j;
char[]c2=new char[end];
for(i=begin,j=0;i<end;i++,j++) {
c2[j]=c1[i];
}
MyString1 c3=new MyString1(c2);
return c3;
}
public MyString1 tolowerCase() {
char c3[];
c3=c1;
for(char e:c3) {
if(e>='A'&&e<='Z') {
int i;//e=e+32
i=e+32;
e= (char)i;
}
}
MyString1 c4=new MyString1(c3);
return c4;
}
public boolean equals(MyString1 s) {
char a1[]=new char[s.length()];
char a2[]=new char[c1.length];
int i;
for(i=0;i<c1.length;i++) {
if(a1[i]!=a2[i]) {
break;
}
}
if(i!=c1.length)
return false;
else
return true;
}
public static MyString1 valueOf(int i) {
int i1=0,i2=0,i3,i4=0,i5;
i5=i;
while(i!=0) {
i=i/10;
i1++;
}
char a []=new char[i1];
while(i5!=0) {
i2=i5%10;
i5=i5/10;
a[i1-1]=(char)(i2+48);
i1--;
}
MyString1 d=new MyString1(a);
return d;
}
public char[] get() {
return c1;
}
}