---
title: "why give different result in this statement"  
description: "why give different result in this statement"  
author: "Amit Singh"  
published: 2010-10-02  
updated: 2011-05-20  
canonical: https://www.mindstick.com/forum/14/why-give-different-result-in-this-statement  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# why give different result in this statement

for example \
[int](https://www.mindstick.com/forum/159137/how-to-convert-date-int-to-date-in-sql) s=23;\
s++ and ++s\
the [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) of s++ and ++s in [java](https://www.mindstick.com/articles/12214/web-development-company-in-india-laid-on-the-foundation-of-concrete-java-programming) is different from [c++](https://www.mindstick.com/blog/745/array-in-c-plus-plus) why?

## Replies

### Reply by Anonymous User

I had tried this code.

This will provide same result according to this senario.

Can you provide a working function so that I will find out possible bugs.


---

Original Source: https://www.mindstick.com/forum/14/why-give-different-result-in-this-statement

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
