C
cyberninja
I have the copy part of this down, but i can't figure out how to copy just the int's from the string.
public class Main extends Object
{
public static void main(String []uuu)
{
String str1 = "",
str2,
str3 ="";
str2 = "1234Now is the time for All ";
str2 += "good men to come to the aid of tHEIR country123456789";
int k;
//Write the code to copy str2 to str1.
//You may not use any String class methods to perform the copy for you.
str1 = str2;
System.out.println(str1);
//Write the code to copy only the digits from str2 to str3.
//You may not use any string class method to perform the copy for you.
str3 = (int) str2;
System.out.println(str3);
}
}
This is where it gets odd, with the (int) it gives me an error.. was wondering what i would to do fix this and make it produce the output
public class Main extends Object
{
public static void main(String []uuu)
{
String str1 = "",
str2,
str3 ="";
str2 = "1234Now is the time for All ";
str2 += "good men to come to the aid of tHEIR country123456789";
int k;
//Write the code to copy str2 to str1.
//You may not use any String class methods to perform the copy for you.
str1 = str2;
System.out.println(str1);
//Write the code to copy only the digits from str2 to str3.
//You may not use any string class method to perform the copy for you.
str3 = (int) str2;
System.out.println(str3);
}
}
This is where it gets odd, with the (int) it gives me an error.. was wondering what i would to do fix this and make it produce the output