Java MCQ Quiz Description

Which of these keywords are used for the block to be examined for exceptions?

  • check

  • throw

  • catch

  • try

What will be the output of the following Java program?


        import java.net.*;
        class networking
        {
&nbs

  • www.sanfoundry.com

  • https://www.xyz.com/javamcq

  • dfddeererer

  • xyz.com

What is the extension of java code files?

  • .js

  • .txt

  • .class

  • .java

Which of the below is not a Java Profiler?

  • JProfiler

  • Eclipse Profiler

  • JVM

  • JConsole

What will be the output of the following Java code?

        class String_demo 
        {
            public static void m

  • abc

  • b

  • c

  • cc

Which one of the following is not a Java feature ?

  •  Object-oriented

  • Use of pointers

  • Portable

  • Dynamic and Extensible

Which one of the following is not an access modifier?

  • Protected

  • Void

  • Public

  • Private

Which of these keywords is used to define interfaces in Java?

  • intf

  • Intf

  • interface

  • Interface

Which of the following is a type of polymorphism in Java Programming?

  • Multiple polymorphism

  • Compile time polymorphism

  • Multilevel polymorphism

  • Execution time polymorphism

What will be the output of the following Java program?
        class Output 
        {
             public static void main(

  • 9.0

  • 8.0

  • 4.0

  • 2.0

Who invented Java Programming?

  • Guido van Rossum

  • James Gosling

  • Dennis Ritchie

  • Bjarne Stroustrup

What will be the output of the following Java code?


        class box 
        {
            int width;
&n

  • 100

  • 400

  • 200

  • 12

Which of these packages contains the exception Stack Overflow in Java?

  • java.io

  • java.system

  • java.lang

  • java.util

Who invented Java Programming?

  • Guido van Rossum

  • James Gosling

  • Dennis Ritchie

  • Bjarne Stroustrup

What will be the output of the following Java program?

        class variable_scope 
        {
            public static

  • Compilation error

  • Runtime error

  •  5 6 5 6

  • 5 6 5

Which class provides system independent server side implementation?

  • Server

  • ServerReader

  • Socket

  • ServerSocket

What will be the output of the following Java code?
        class Output 
        {
             public static void main(Str

  • 3

  • 0

  • 4

  • 3.0

What will be the output of the following Java program?

class overload 
       {
            int x;
         double

  • 4 6.4

  • 6.4 6

  • 6.4 6.4

  • 6 6

What will be the output of the following Java code snippet?


    class abc
    {
        public static void main(String args[])
   &

  • The snippet compiles and runs but does not print anything

  • The snippet compiles, runs and prints 0

  • The snippet compiles, runs and prints 1

  • The snippet does not compile

What is the use of final keyword in Java?

  • When a class is made final, a sublcass of it can not be created.

  • When a method is final, it can not be overridden.

  • When a variable is final, it can be assigned value only once.

  • All of the above

What is the extension of compiled java classes?

  • .txt

  • .js

  • .class

  • .java

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 will be the output of the following Java program?

        class output 
        {
            public static void mai

  • QuizziuQ

  • ziuQQuiz

  • Quiz

  • ziuQ

What is the numerical range of a char data type in Java?

  • 0 to 256

  • -128 to 127

  • 0 to 65535

  • 0 to 32767

Which environment variable is used to set the java path?

  • MAVEN_Path

  • JavaPATH

  • JAVA

  • JAVA_HOME

What will be the output of the following Java code?

        class newthread extends Thread
        {
        Thread t;
 

  • truetrue

  • falsefalse

  • true

  • false

What will be the output of the following Java program?

        class recursion 
        {
            int func (int n)&nb

  • 1

  • 120

  • 0

  • None of the mentioned

What will be the output of the following Java code?


        class Output 
        {
            public static voi

  • 257

  • 256

  • 1

  • 0

What is Truncation in Java?

  • Floating-point value assigned to a Floating type

  • Floating-point value assigned to an integer type

  • Integer value assigned to floating type

  • Integer value  is not assigned to floating type

What will be the output of the following Java code?

        class increment {
            public static void main(String args[]) 
   &nb

  • 32

  • 33

  • 24

  • 25