public static void main(String args)
This what we normally done using arith operator '+'.
I want the answer c=4 without using '+' or any arith operator.
Pls suggest ur ideas through the example.. i m a beginner in java so i can clearly understand... Hoping for u r answers......
c=a+b; - here is arithmetic operator . System.out.println("C="+c); - here is overloaded operator + .
Here this mean CONCATENATION of two String-s.
You can asked: c is not a String type. Yes it is true, but c is casting to String automatically before join.
In Your case You can write:
System.out.println(""+c);// "" (an empty String) can cast integer to String
How to eliminate sign + :
System.out.println(c);// "" automatic cast int to String
Remark: Sign + in arithmetic has two menings:
1. before a single number indicate, positive number
2. between two numbers , sum operation
Try write: System.out.println(c++); or System.out.println(++c); try explain difference
what part of "the answer has already been given" didn't you understand? if you think we're not more experienced in Java than you are, I hope you do realise we seem to be just a tad farther in our knowledge of the English language.
just write the pgm for
why the hell would we want to do that? that's your assignment, not ours. you've already been told how, so, like you said: