adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class output
    {
        public static void main(String args[])
        {
            char c[]={'a','1','b',' ','A','0'];
            for (int i = 0; i < 5; ++i)
            {
         if(Character.isDigit(c[i]))
                    System.out.println(c[i]" is a digit");
                if(Character.isWhitespace(c[i]))
                   System.out.println(c[i]" is a Whitespace character");
                if(Character.isUpperCase(c[i]))
                   System.out.println(c[i]" is an Upper case Letter");
                if(Character.isUpperCase(c[i]))
                   System.out.println(c[i]" is a lower case Letter");
                i = i + 3;
            }
        }
    }

a.

a is a lower case Letter
is White space character

b.

b is a lower case Letter
is White space characte

c.

a is a lower case Letter
A is a upper case Letter

d.

a is a lower case Letter
0 is a digit

Posted under Java Programming

Answer: (a). a is a lower case Letter
is White space character

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?

Similar Questions

Discover Related MCQs

Q. Which of these class contains the methods used to write in a file?

Q. Which of these exception is thrown in cases when the file specified for writing is not found?

Q. Which of these methods are used to read in from file?

Q. Which of these values is returned by read() method is end of file (EOF) is encountered?

Q. Which of these exception is thrown by close() and read() methods?

Q. Which of these methods is used to write() into a file?

Q. Which of these functions is called to display the output of an applet?

Q. Which of these methods can be used to output a string in an applet?

Q. Which of these methods is a part of Abstract Window Toolkit (AWT) ?

Q. Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?

Q. Which of these operators can be used to get run time information about an object?

Q. An applet is a Java class that extends the

Q. Applets are designed to be embedded within an __________.

Q. Which of the following is required to view an applet?

Q. Which method is automatically called after the browser calls the init method?

Q. Which method is only called when the browser shuts down normally?

Q. Which method causes the audio clip to replay continually?

Q. paint() is an abstract method defined in AWT.

Q. ___________ method is defined in Graphics class, it is used to output a string in an applet.

Q. Java I/O is used to process the?