Computer Science, asked by vijayawatikee, 1 year ago

Debug:-import java.util.*;public class ss{void ff() { Scannerin=newScanner(System.in); char c; System.out.println("ss"); c=in.next().charAT(0); if(c=='R'||c=='r') { System.out.println("ssssasdasd");}else{ System.out.println("asdasd");}}}

Answers

Answered by kvnmurty
0
See the following program... that runs correctly.
=============

import java.util.*;import java.lang.* ;

class myClass     {    //     "public"

    public static void main (String[] args) throws java.lang.Exception  {
        char c;  String s;

           Scanner  in = new Scanner(System.in);
              System.out.println("start");
              s = in.next();     //   store string in s...
              c = s.charAt(0);

               if (c=='R'|| c=='r')
                      System.out.printf(" :%s : %c: ",s,c) ;
             else
                       System.out.println(" .-.-.=.-.-");
 
     }  // main

}// class

kvnmurty: :)
Similar questions