alternative
  • Home (current)
  • About
  • Tutorial
    Technologies
    C#
    Deep Learning
    Statistics for AIML
    Natural Language Processing
    Machine Learning
    SQL -Structured Query Language
    Python
    Ethical Hacking
    Placement Preparation
    Quantitative Aptitude
    View All Tutorial
  • Quiz
    C#
    SQL -Structured Query Language
    Quantitative Aptitude
    Java
    View All Quiz Course
  • Q & A
    C#
    Quantitative Aptitude
    Java
    View All Q & A course
  • Programs
  • Articles
    Identity And Access Management
    Artificial Intelligence & Machine Learning Project
    How to publish your local website on github pages with a custom domain name?
    How to download and install Xampp on Window Operating System ?
    How To Download And Install MySql Workbench
    How to install Pycharm ?
    How to install Python ?
    How to download and install Visual Studio IDE taking an example of C# (C Sharp)
    View All Post
  • Tools
    Program Compiler
    Sql Compiler
    Replace Multiple Text
    Meta Data From Multiple Url
  • Contact
  • User
    Login
    Register

Java - Thing to know before proceed - Variable Quiz

# Quiz
1
Discuss
Variable

Which of these is long data type literal?

  • 1]

     0x99fffL

  • 2]

    ABCDEFG

  • 3]

    0x99fffa

  • 4]

    99671246

Solution
2
Discuss
Variable

Which of these can be returned by the operator &?

  • 1]

    Integer

  • 2]

    Boolean

  • 3]

    Character

  • 4]

    Integer or Boolean

Solution
3
Discuss
Variable

What will be the output of the following Java program?

    public class dynamic_initialization 
    {
        public static void main(String args[]) 
        {
            double a, b;
            a = 3.0;
            b = 4.0;
	    double c = Math.sqrt(a * a + b * b);
	    System.out.println(c);
        } 
    }

 

  • 1]

    5.0

  • 2]

    25.0

  • 3]

    7.0

  • 4]

    Compilation Error

Solution
4
Discuss
Variable

What will be the output of the following Java program?

    public 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);
        } 
    }

 

  • 1]

    5 6 5 6

  • 2]

    5 6 5

  • 3]

    Runtime error

  • 4]

    Compilation error

Solution
5
Discuss
Variable

What will be the output of the following Java program?

    public 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++;
            }
 
        } 
    }

 

  • 1]

    0 2 4 6 8

  • 2]

    1 2 3 4 5

  • 3]

     0 1 2 3 4 5 6 7 8 9

  • 4]

    1 2 3 4 5 6 7 8 9 10

Solution
6
Discuss
Variable

What will be the output of the following Java program?

    public 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);
        } 
    }

 

  • 1]

    38

  • 2]

    39

  • 3]

    40

  • 4]

    41

Solution
7
Discuss
Variable

Which of these can not be used for a variable name in Java?

  • 1]

    identifier

  • 2]

    keyword

  • 3]

    identifier & keyword

  • 4]

    none of the mentioned

Solution
# Quiz
Java

Java

  • Introduction
  • Installation and running a first java program
    • JDK Installation
    • Environment Variable Path Setup
    • Running a first java program
  • 1st Java Program Explanation
    • Program Syntax
  • JDK,JRE,JVM
    • JRE
    • JDK
    • JVM
  • Thing to know before proceed
    • Variable
    • Datatype
    • Operator
    • Keyword
    • Access Modifier
  • Decision Control and looping statement
    • If-else
    • Switch
    • For
    • While
    • do-while
    • break
    • continue
  • Object-Oriented Programming (OOPS) Concept
    • About OOPs
    • Object & Class
    • Inheritance
    • Polymorphism (Runtime & Compile Time)
    • Abstraction (Using abstract and interface)
    • Encapsulation

About Fresherbell

Best learning portal that provides you great learning experience of various technologies with modern compilation tools and technique

Important Links

Don't hesitate to give us a call or send us a contact form message

Terms & Conditions
Privacy Policy
Contact Us

Social Media

© Untitled. All rights reserved. Demo Images: Unsplash. Design: HTML5 UP.