Java Interview Question

A modern, colorful illustration representing Java programming concepts, with elements such as code snippets, a laptop, and abstract geometric shapes.

Java Programming Quiz

Test your knowledge of Java programming with our comprehensive quiz! Perfect for beginners and experienced developers alike, this quiz covers essential concepts that every Java programmer should know.

Join us and discover:

  • Platform independence in Java
  • Java data types and their sizes
  • Object-oriented programming concepts
  • Syntax and scope of variables
13 Questions3 MinutesCreated by CodingWizard542
Email:
Which statement is true about Java?
Java is a sequence-dependent programming language
Java is a code dependent programming language
Java is a platform-dependent programming language
Java is a platform-independent programming language
What is the extension of java code files?
.txt
.class
.js
.java
Which of the following is not an OOPS concept in Java?
Inheritance
Polymorphism
Encapsulation
Compilation
In java byte, short, int and long all of these are?
Unsigned
Signed
Both of them
None of them
Size of int in java?
16 bit
32 bit
64 bit
Depends on the environment
What is the extension of compiled java classes?
.txt
.js
.class
.java
The smallest integers data type is ____ and it’s size is ___ bit?
Short, 8
Short, 32
Short, 16
Byte, 8
Which one of the following is valid statement?
Char[] c = new char();
Char[] c = new char[];
Char[] c = new char(4);
Char[] c = new char[5];
int x=0, y=0, z=0;
x = (++x + y++) * z++;
 

What will be the output for “x”?

-2
-1
0
1
What will be the correct output for the following code?

class increment {

       public static void main(String args[])

       {       

            int g = 3;

            System.out.print(++g * 8);

       }

   }

32
33
24
25

What will be the output of the following Java program?

class variable_scope

   {

       public static void main(String args[])

       {

           int x;

           x = 5;

           {

        int y = 6;

        System.out.print(x + " " + y);

           }

           System.out.println(x + " " + y);

       }

   }

5 6 5 6
5 6 5
Runtime error
Compilation error
{"name":"Java Interview Question", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of Java programming with our comprehensive quiz! Perfect for beginners and experienced developers alike, this quiz covers essential concepts that every Java programmer should know. Join us and discover: Platform independence in Java Java data types and their sizes Object-oriented programming concepts Syntax and scope of variables","img":"https:/images/course5.png"}
Powered by: Quiz Maker