Comment on Tutorial - Using read() to read one character at a time from console input By Jagan



Comment Added by : Nitish

Comment Added at : 2013-01-25 04:06:38

Comment on Tutorial : Using read() to read one character at a time from console input By Jagan
package alphabets;

import java.util.Scanner;

/**
*
* @author User
*/
class Alphabets
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
char ch1,ch2;
ch1 = input.next().charAt(0);
ch2 = input.next().charAt(0);
System.out.println("Your Frist Character is: "+ch1);
System.out.println("Your Second Character is: "+ch2);
boolean flag = true;
if(ch1 == ch2)
{
System.out.println(flag);
}
else
{
flag = false;
System.out.println("Character did not match "+flag);
}
}
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Thank you very much.
View Tutorial          By: allcracked at 2013-09-11 19:10:20

2. why the java program must be written in side the c
View Tutorial          By: surendra at 2009-04-01 09:02:42

3. I am still going through the tutorial, but it seem
View Tutorial          By: shadowwraith at 2011-06-08 08:00:57

4. pls help me how to solve the timeout problem

View Tutorial          By: nisha at 2010-09-20 22:29:17

5. well understood
View Tutorial          By: shanthini at 2014-04-07 17:19:20

6. can you send me comm.jar required for this project
View Tutorial          By: rahul at 2012-10-20 12:21:42

7. import java.io.*;
import java.util.*;

View Tutorial          By: srikanth at 2014-05-30 06:44:58

8. I want to ask, can a formula be inserted in this s
View Tutorial          By: chika at 2011-02-02 17:18:59

9. I tried the first option i.e for refresh use Forwa
View Tutorial          By: dinesh at 2009-07-31 05:31:23

10. Hello all,
Please help me out. I want to cr

View Tutorial          By: Richa Bhatia at 2009-12-07 22:55:54