"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 |
Explain JSP life cycle?
can u draw class/object diagram for ATM
0 Answers HCL, Zycus Infotech,
Which sorting algorithm is used by collections.sort() in java ?
What are maps interfaces in the java collections? : java collections
what is the diffrence between insurance and telecom domain?
What is java collection? : java collections
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
What is the use of log4j and how to make use of that in a application?
Q1. A. Write note on "The class path Environment Variable". B. Which are different kinds of source code? Q2. A. How to create an interface? B. Why convert an applet to an application? Q3. A. How to use Media tracker Class. B. How to use string tokenizer class. Q4. A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on "The properties class" Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.
What is an algorithm in java collection framework? : java collections
Difference between Spring framework and Struts framework?
12 Answers IBM, L&T, VAM,
Which is the better framework for web applications, struts or spring, and why?