GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 25 of 104    Print  
What is the difference between & and && operators?

  
Total Answers and Comments: 2 Last Update: April 11, 2006     Asked by: Ashruf 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 10, 2006 12:57:43   
rohit singhal        

RE: What is the difference between & and && operators?...

the && operator is a short circuit operator means if it gets its first operand false it never go to its second operand . but & is not .

for ex:

if i 0;

if(i && i++)

{ System.out.println(i);}

it will print i 0 not 1.


 
Is this answer useful? Yes | No
April 11, 2006 01:36:02   
Mohammad Asif        

RE: What is the difference between & and && operators?...

Boolean Logical Operators - & (Logical AND) | (Logical Inclusive OR) ^ (Logical Exclusive OR ) :

Boolean Logical Operators can be applied to Boolean Operands returning a Boolean Value. It can also be applied to integral operands to perform bitwise logical operations. They also have Boolean Logical Compound Assignment Operators i.e. & ^ | .

Conditional Operators - ( && || ) :

They are similar to logical operators but their evaluation is short-circuited. These can be applied only to Boolean Operands ( Not to Integral Operands ). They have no compound assignment operators


 
Is this answer useful? Yes | No

 Related Questions

What is the difference between Abstract Factory Pattern and factory Pattern? When would you use each of them? 
Latest Answer : Abstract factory pattern is typically used for giving implementation to specification (eg., jdbc, servlet specifications etc...). Factory pattern is used when you want to defer object creation to later stages (when concrete implementation of that class/interface ...
Read Answers (3) | Asked by : santanu
Tags : Abstract

Latest Answer : In C args[0] = filename args[1]= first argumentin Java args[0] = first argument ...

Latest Answer : OBJECTS SIT ON HEAPPRIMITIVES (LIKE INT, DOUBLE ETC) SIT ON STACKSTACK IS FASTER THAN HEAP.OBJECTS ARE PASSED BY REFERENCE.  PRIMITIVES ARE PASSED BY VALUE.OBJECTS ARE GARBAGE COLLECTED.  PRIMITIVES ARE CLEARED FROM THE STACK BY MOVING THE STACK ...

Latest Answer : java.sql.Date - Used mainly while storing in the databasejava.util.Date - Used to format the date ...
Read Answers (10) | Asked by : murthy

Latest Answer : Marshalling is one kind of converting data and objects into byte streams and unmarshalling is reverse process of this. ...
Read Answers (4) | Asked by : shekhar

What is the difference between light weight component(like swing) and heavy weight component(like awt).
Read Answers (9) | Asked by : Naresh

Latest Answer : Boolean Logical Operators - & (Logical AND), | (Logical Inclusive OR), ^ (Logical Exclusive OR ) :Boolean Logical Operators can be applied to Boolean Operands returning a Boolean Value. It can also be applied to integral operands to perform ...
Read Answers (2) | Asked by : Ashruf

Latest Answer : Hi Friends,JavaBeans may be visible or nonvisibleat runtime. For example, the visual GUI component may be a button, list box, graphic, or a chart An EJB is a nonvisual, remote objectJava Beans are intended to be local to a single process and are ...

Latest Answer : Thin client is browser based and thick client is window based ...
Read Answers (4) | Asked by : naresh

Latest Answer : hi       A J2EE application is packaged as a portable deployment unit called an     enterprise archive (EAR) file. An EAR file is standard JAR file with a .ear  extension. An EAR file contains:One ...
Read Answers (6) | Asked by : srinu


 Sponsored Links

 
Related Articles

C++ Memory Management operators

C Memory Management operators Need for Memory Management operators The concept of arrays has a block of memory reserved The disadvantage with the concept of arrays is that the programmer must know while programming the size of memory to be allocated in addition to the array size remaining constant m
 

C++ Operators Part II

Operators in C Part II In this C tutorial you will learn about logical operators operator operator conditional operator comma operator bitwise operator and sizeof operator mosgoogle center Logical Operators The logical operators used are The operator is called NOT operator This has a single
 

C++ Operators Part I

C Operators Part I In this C tutorial you will learn about operators assignment operator arithmetic operators compound assignment operators increment and decrement operator the functionality of prefix and postfix operators relational and equality operators mosgoogle center The operators available in
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

Precedence of Operators

What is precedence of operators? When number of operators occurs in an expression the operator which is to be evaluated first is judged by applying priority of operators. The arithmetic operators available in C are + used for Addition - used for Subtraction * used for Multiplication / used for D
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

Difference between Scholarship and Grant

Difference between Scholarship and Grant While both scholarships and grants allow students to pay for their tuition without having to pay the money back there are a number of key differences between the two Knowing the difference between grants and scholarship will make it much easier for students t
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape