"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 |
What are the interfaces in java collections? : java collections
What is the enumerator of the java collection framework? : java collections
How is hashset maintained in memory by java ?
In hyderabad, which s/w training center is best for java, other than corejava what r the new tools to learn in java,which tool is best & have current requirement,pls give me information about java to learn ?
What are the uses of the set interfaces in the java collections? : java collections
what protocols does JNDI provide an interface to?
What do you understand by synchronization? Why is it important?
What is the use of the list interface in the java collection? : java collections
How to call the m1() method of Base class in below snippet ? class Base { public void m1() { System.out.println("Base m1 "); } public void m2() { System.out.println("Base m1 "); } } ====================== class Derived extends Base { public void m1() { System.out.println("Derived m1"); } public void m3() { System.out.println("Derived m3"); } public static void main(String[] args) { Base ob=new Derived(); ob.m1(); //System.out.println("Hello World!"+ob.m1()); } }
Which is the better framework for web applications, struts or spring, and why?
What is difference between Application Server and Web Server?
What is markup language?