adplus-dvertising

Welcome to the Data Types,Variables and Arrays MCQs Page

Dive deep into the fascinating world of Data Types,Variables and Arrays with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Data Types,Variables and Arrays, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Data Types,Variables and Arrays, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Java Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Data Types,Variables and Arrays. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Java Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Data Types,Variables and Arrays. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Data Types,Variables and Arrays MCQs | Page 1 of 32

Q1.
What is the numerical range of a char data type in Java?Which of these coding types is used for data type characters in Java?
Discuss
Answer: (b).0 to 65535UNICODE
Q2.
What is the numerical range of a char data type in Java?
Discuss
Answer: (d).0 to 65535
Q3.
Which of these values can a boolean variable contain?
Discuss
Answer: (a).True & False
Q4.
Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
Discuss
Answer: (d).ASCII and ISO-LATIN1
Q5.
Which one is a valid declaration of a boolean?
Discuss
Answer: (c).boolean b3 = false;
Q6.
What is the output of this program?
class array_output {
        public static void main(String args[]) 
        {    
            char array_variable [] = new char[10];
     for (int i = 0; i < 10; ++i) {
                array_variable[i] = 'i';
                System.out.print(array_variable[i] + "" );
                i++;
            }
        } 
    }
Discuss
Answer: (a).i i i i i
Q7.
What is the output of this program?
class mainclass {
        public static void main(String args[]) 
        {
            char a = 'A';
            a++;
     System.out.print((int)a);
        } 
    }
Discuss
Answer: (a).66
Discuss
Answer: (a).Ascending order
Q9.
Can we create an instance of Enum outside of Enum itself?
Discuss
Answer: (b).False
Q10.
What is the output of this piece of code?
enum Season {
        WINTER, SPRING, SUMMER, FALL
    };
    System.out.println(Season.WINTER.ordinal());

a.

0

b.

1

c.

2

d.

3

Discuss
Answer: (a).0
Page 1 of 32

Suggested Topics

Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!