Java Interview Question

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/QJV7DJYE9","txt":"Email:, Which statement is true about Java?, What is the extension of java code files?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker