"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



"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the jav..

Answer / sreekanth madamanchi

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

"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the jav..

Answer / qamrun nisa

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

"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the jav..

Answer / rakesh kumar mishra

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

"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the jav..

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

"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the jav..

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

"Sun Certified Java Programmer" This is one String , we need to print SCJP, write the jav..

Answer / java_allinterview_faq

by : Viswathan

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Java J2EE AllOther Interview Questions

Write a interface "CarOperations" with the following methods void turnOnEngin() void turnOffEngin() void turnOnLigths() void turnOffLights() void turnLeft() void turnRight() void accelerate() void deaccelerate() void putBreaks() void releaseBreaks()

1 Answers  


what is acl(access control list)?

1 Answers   Athena, HCL,


How do you create UserTransaction Object? How do you rollback a transaction in a method?

1 Answers   HCL,


VSS Objectives

1 Answers  


what is difference between web server and application server?

1 Answers   L&T,






What is markup language?

1 Answers  


what protocols does JNDI provide an interface to?

1 Answers  


What is the Spring2.5 MVC Navigation flow?

1 Answers   IBM,


Which interface does java.util.hashtable implement?

0 Answers  


waht are architecture of web application?

2 Answers  


Which java collection class can be used to maintain the entries in the order in which they were last accessed?

0 Answers  


Difference between Spring framework and Struts framework?

12 Answers   IBM, L&T, VAM,


Categories