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 4 of 32

Q31.
Literal can be of which of these data types?
Discuss
Answer: (d).all of the mentioned
Q32.
Which of these can not be used for a variable name in Java?
Discuss
Answer: (b).keyword
Q33.
What is the output of this program?
    class evaluate 
    {
        public static void main(String args[]) 
        {
            int a[] = {1,2,3,4,5};
     int d[] = a;
     int sum = 0;
     for (int j = 0; j < 3; ++j)
                sum += (a[j] * d[j + 1]) + (a[j + 1] * d[j]);
     System.out.println(sum);
        } 
    }
Discuss
Answer: (c).40
Q34.
What is the output of this program?
    class array_output 
    {
        public static void main(String args[]) 
        {
            int array_variable [] = new int[10];
     for (int i = 0; i < 10; ++i) {
                array_variable[i] = i/2;
                array_variable[i]++;
                System.out.print(array_variable[i] + " ");
                i++;
            }
 
        } 
    }
Discuss
Answer: (b).1 2 3 4 5
Discuss
Answer: (b).The destination type is larger than source type
Q36.
What is the prototype of the default constructor of this class?

public class prototype { }
Discuss
Answer: (d).public prototype( )
Discuss
Answer: (b).* operator has converted b * 50 into int, which can not be converted to byte without casting
Q38.
If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?
Discuss
Answer: (c).double
Discuss
Answer: (a).Floating-point value assigned to an integer type
Q40.
What is the output of this program?
    class char_increment 
    {
        public static void main(String args[]) 
        {
            char c1 = 'D';
            char c2 = 84;
            c2++;
            c1++;
            System.out.println(c1 + " "  + c2);
        } 
    }
Discuss
Answer: (a).E U
Page 4 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!