Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • String-Print a string character then extract user entered letter match with that word and append it as different word

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 58
    Answer it


    Its not entering the If loop in the code snippet, couldn't get what's wrong in this logic.


     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
    //first extract any userdefined letter from word and form a word
    package myfirst;
    import java.util.Scanner;
     * @author kiit
    public class Wrdpttrn {
        InputStreamReader inp = new InputStreamReader(;
        BufferedReader br = new BufferedReader(inp);
        StringBuilder sb=new StringBuilder();
         Scanner scanner = new Scanner(;
        public void extractWord(String t){
            char arr[]=t.toCharArray();
           // boolean b;
           for(char c : arr){
               for(int i=0;i<=t.length();i++){
                   char c1 =;
                System.out.println("Enter character from particular string sequence:"+c1);
                 //boolean b=true;
                    System.out.println("You have entered: "+c1);
                System.out.println("Enter character from particular string sequence1:");
               // else{
               // }
                    //System.out.println("Enter character from particular string sequence2:");
        public static void main(String args[]){
            Wrdpttrn wp=new Wrdpttrn();


 0 Answer(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: