alternative
  • Home (current)
  • About
  • Tutorial
    Technologies
    SQL -Structured Query Language
    Python
    Ethical Hacking
    Java
    .net Framework
    Placement Preparation
    Quantitative Aptitude
    View All Tutorial
  • Quiz
    SQL -Structured Query Language
    Quantitative Aptitude
    Java
    View All Quiz Course
  • Q & A
    Quantitative Aptitude
    Java
    View All Q & A course
  • Programs
  • Articles
    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 - Decision Control and looping statement - Switch Quiz

# Quiz
1
Discuss
Switch

Which of these selection statements test only for equality?

  • 1]

    if

  • 2]

    switch

  • 3]

    if & switch

  • 4]

    none of the mentioned

Solution
2
Discuss
Switch

Which of this statement is incorrect?

  • 1]

    switch statement is more efficient than a set of nested ifs

  • 2]

    two case constants in the same switch can have identical values

  • 3]

    switch statement can only test for equality, whereas if statement can evaluate any type of boolean expression

  • 4]

    it is possible to create a nested switch statements

Solution
3
Discuss
Switch

What will be the output of the following Java program?

    class Output 
    {
        public static void main(String args[]) 
        {    
             int a = 5;
             int b = 10;
             first: 
             {
                second: 
                {
                   third: 
                   { 
                       if (a ==  b >> 1)
                           break second;
                   }
                   System.out.println(a);
                }
                System.out.println(b);
             }
        } 
    }

 

  • 1]

    5 10

  • 2]

    10 5

  • 3]

    5

  • 4]

    10

Solution
4
Discuss
Switch

What is the valid data type for variable “a” to print “Hello World”?

switch(a)
{
   System.out.println("Hello World");
}

 

  • 1]

    int and float

  • 2]

    byte and short

  • 3]

    char and long

  • 4]

    byte and char

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.