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
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
=============
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
Physics,
8 months ago
Political Science,
8 months ago
English,
8 months ago
Math,
1 year ago
Environmental Sciences,
1 year ago
Biology,
1 year ago