--%>

Type promotion rule

Q. Explain type conversion rules for basic data types in java.

Ans. Type promotion rule: Java automatically each bits or short operant to int when evaluating an expression. As usual as the automatic promotions are, they can cause confusing compile time errors.

Type promotions rule: Java defines several types promotions rule:

1.      Byte and short values are promotes in your int.

2.      If one operand is long then whole operation is promoted to long.

3.      If one is float, then the expression will be float.

4.      If any is double, then result will be double.

 

 

 

   Related Questions in Programming Languages

  • Q : What are good examples of XHTML

    What are the good examples of XHTML elements along with contents?

  • Q : Use Finite-State Space Abstractions Use

    Use Finite-State Space Abstractions: In order to successfully apply explicit-state model checking, defects must be detectable in a sufficiently small state space. This can be achieved either by means of heuristics that constrain the way the state spac

  • Q : Kernel Mode Illustrate what are the

    Illustrate what are the different functions of Kernel Mode, interrupts and system calls?

  • Q : Explain the term XForms Explain the

    Explain the term XForms.

  • Q : Define the term Host system Define the

    Define the term Host system: It is a computer system on which a process is executed or run.

  • Q : Explain the benefits of distributed

    Explain the benefits of distributed systems.

  • Q : Define Swapping Swapping : An

    Swapping: An {operating system} is frequently able to run programs which need more memory than is physically accessible on the host system. In order to do this, the complete memory needed is broken down into smaller pieces that are swapped in whenever

  • Q : What is Logical error Logical error :

    Logical error: It is an error in the logical of a class or method. Such an error may not lead to an instant runtime error, however could have a noteworthy impact on overall program exactness.

  • Q : What are collections and generics What

    What are collections and generics?

  • Q : File handling modes and corresponding

    Discover Q & A

    Leading Solution Library
    Avail More Than 1452770 Solved problems, classrooms assignments, textbook's solutions, for quick Downloads
    No hassle, Instant Access
    Start Discovering

    18,76,764

    1957315
    Asked

    3,689

    Active Tutors

    1452770

    Questions
    Answered

    Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!

    Submit Assignment

    ©TutorsGlobe All rights reserved 2022-2023.