GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 408 of 493    Print  
Why statement printf("%d%d%d",++a,a,a++) in C and = a++; System.out.printf("%d%d%d",++a,a,a++) in Java gives different output?
Because in C++ function argument associativity is right to left but in java it is left to right


  
Total Answers and Comments: 1 Last Update: August 03, 2007     Asked by: lcbishnoi 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 03, 2007 06:31:40   #1  
sujatham Member Since: January 2006   Contribution: 142    

RE: Why statement printf("%d%d%d",++a,a,a++) in C and ...

yes.

postfix operator in  java have left-to-right associativity.

But in C postfix  operator have right-to-left associativity.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Memory leaks are possible in Java. There is a possibility that the garbage collector may never even run during an application's lifetime, even if it is explicitly invoked by calling System.gc(). The garbage collector won't be automatically run ...

Latest Answer : JavaBeans are just regular class files. They have get and set methods only. They are not controlled by separate EJB server like JBOSS etc, They can easily work on JVM itself and they dont require any application/EJB server.EJB'S also have get and ...

Latest Answer : Java is only pass-by-value language. Passing a reference is not possible though you can pass by value. If you want changes to reflect back then consider the primitive type in a custom class not a wrapper class i.e., to say, this class will have getter ...

Latest Answer : 1 - Java does not support operator overloading 2 - Java does not take template 3 - It does not support multiple inheritance, however in internet it users multiple inheritance4 - Java does not support global variable5 - Destructor are not used in ...

Latest Answer : hi,To achieve multiple Inheritance in java we must use Interface. ...

Latest Answer : Primary Advantages is, we don't need to add code in Java Class(attribute, Mutator Method[get/set]), Sipmply we can add new attributes by modifying XML files. Eg . ActionForm and DynaActionForm in Struts FrameWork. ...

Latest Answer : primtive datatyp is non object datatypeint chat short byte long float double boolean ...

Latest Answer : Yes. Every thread maintains its own separate stack, called Runtime Stack but they share the same memory. Elements of the stack are the method invocations, called activation records or stack frame. The activation record contains pertinent information ...

Latest Answer : HiHeap is the location where a object is stored after it is instansiated.Means after A obj=new A();now obj will be storeed in heap. ...

Latest Answer : In Java Object are passed by reference and Primitive data is always pass by value ...


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

C++ Standard Input Output Stream

C Standard Input Output Stream In this C tutorial you will learn about standard input stream and standard output stream explained along with syntax and examples C programming language uses the concept of streams to perform input and output operations using the keyboard and to display information on
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

What are the Format Specifiers used with printf?

There are several format specifiers available in printf. The format specifier used varies depending on the data type used for printing. The given below are some of the format specifiers used with printf in C program. For integer data type the format specifier used with printf is %d or %i For float
 

What are the limitations with switch statement?

Switch statement is a powerful statement used to handle many alternatives and provides good presentation for C program. But there are some limitations with switch statement which are given below: Logical operators cannot be used with switch statement. For instance case k>=20: is not allowe
 

printf and sprintf

What is the difference between printf and sprintf? sprintf: Writes formatted data to a character string in memory instead of stdout Syntax of sprintf is: #include <stdio.h> int sprintf (char *string, const char *format [,item [,item]...]); Here, String refers to the pointer to a
 

goto Statement

Why to avoid goto in C C has goto statement but one must ensure not to use too much of goto statement in their program because its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated. First let us understand the goto statement, its
 

System Implementation

In the previous articles relating to SDLC Stages we discussed about Project Planning and Feasibility Study moved on to System Analysis and Requirements which lead to Systems Design. Systems Design will naturally lead to another stage where it becomes closer to the actual deployment of the p
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape