"Sun Certified Java Programmer" This is one String , we need
to print SCJP, write the java code dynamically? pls reply
this questions
Answers were Sorted based on User's Feedback
public class Sample {
public static void main(String args[]) {
String str = "Sun Certified Java Programmer";
String str2 = null;
for(int i=0;i<str.length();i++)
{
char c = str.charAt(i);
if(Character.isUpperCase(c))
{
if(str2 == null || str2 == "")
str2 = ""+str.charAt(i);
else
str2 = str2+str.charAt(i);
}
}
System.out.println("Result="+str2);
}
}
Is This Answer Correct ? | 10 Yes | 2 No |
public class Sample {
public static void main(String args[]) {
String str = "Sun Certified Java Programmer";
StringTokenizer st = new StringTokenizer(str, " ");
while (st.hasMoreTokens()) {
String value = st.nextToken();
System.out.print(value.charAt(0));
}
}
}
Is This Answer Correct ? | 5 Yes | 0 No |
public class Sample
{
public static void main(String args[])
{
String str = "Sun Certified Java Programmer";
StringTokenizer st=new StringTokenizer(str," ");
while(st.hasMoreTokens())
{
String value=st.nextToken();
System.out.println(value.charAt(0));
}
}
}
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / karan
package test;
public class NewTest {
public static void main(String args[]) {
String[] strArr = strArr = "Sun Certified Java Programmer".split(" ");
System.out.println(strArr[0].charAt(0) + "" + strArr[1].charAt(0)+ "" + strArr[2].charAt(0)+ "" + strArr[3].charAt(0));
}
}
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / dhinesh manthiram
class Krish {
public static void main(String args[]) {
String str = "Sun Certified Java Programmer";
String str2="";
for(int i=0;i<str.length();i++)
{
char c = str.charAt(i);
if(Character.isUpperCase(c))
{
str2 = str2+c;
}
}
System.out.println("Result="+str2);
}}
Is This Answer Correct ? | 1 Yes | 0 No |
How many controlers are there in spring? Plz send me ans
how to delete cookie information?and when it will delete?
"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the java code dynamically? pls reply this questions
what is class/object diagram
What are the queues in the java collection framework? : java collections
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What is need of DAO? Write one simple DAO example?
what is difference between business deligate and session facade ?
what is the IDE that you have used to write your java programs?
2 Answers Inforica, Interface Software,
What are the types of interface used in the java collections? : java collections
What are the differences between the java collection and the java list? : java collections
who should use JNDI?