Prev: ?k???O?T?h???C
Next: JVM and java application
From: Robbo on 24 Jan 2010 19:21 Hello, I need to create complete table of Java operators with their priorities and associations. In Sun's web page there is such table but not complete (e.g. there are no operators like (), .), there is only one sentence about associations. I tried to create such a table myself, but do not know if it is correct. Please, check my table or provide me with some good link where I may find good table. Thx. Kategoria Operator ��czno�� ??? () [] . Left to right Postfix expr++ epxr-- Right to left Unary ++expr --expr Right to left +expr -expr ! ~ Multiplicative * / % Left to right Additive + - Left to right Shift >> >>> << Left to right Relational > >= < <= Left to right instanceof Equality == != Left to right Bitwise AND & Left to right Bitwise XOR ^ Left to right Bitwise OR | Left to right Logical AND && Left to right Logical OR || Left to right Conditional ?: Right to left Assignment = += -= *= Right to left /= %= >>= <<= >>>= &= ^= |= Comma , Left to right Robbo
From: John B. Matthews on 24 Jan 2010 21:45 In article <hjioae$jef$1(a)atlantis.news.neostrada.pl>, "Robbo" <nie.mam(a)yle.com> wrote: > Hello, > > I need to create complete table of Java operators > with their priorities and associations. In Sun's web > page there is such table but not complete (e.g. there > are no operators like (), .), there is only one sentence > about associations. I tried to create such a table > myself, but do not know if it is correct. Please, > check my table or provide me with some good > link where I may find good table. > > Thx. > > Kategoria Operator £±czno¶æ > ??? () [] . Left to right > Postfix expr++ epxr-- Right to left > Unary ++expr --expr Right to left > +expr -expr ! ~ > Multiplicative * / % Left to right > Additive + - Left to right > Shift >> >>> << Left to right > Relational > >= < <= Left to right > instanceof > Equality == != Left to right > Bitwise AND & Left to right > Bitwise XOR ^ Left to right > Bitwise OR | Left to right > Logical AND && Left to right > Logical OR || Left to right > Conditional ?: Right to left > Assignment = += -= *= Right to left > /= %= >>= > <<= >>>= &= > ^= |= > Comma , Left to right Sun: <http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html> Princeton: <http://www.cs.princeton.edu/introcs/11precedence/> University of West Florida: <http://www.cs.uwf.edu/~eelsheik/cop2253/resources/op_precedence.html> -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
From: Lew on 24 Jan 2010 22:36 Robbo wrote: >> I need to create complete table of Java operators >> with their priorities and associations. In Sun's web >> page there is such table but not complete (e.g. there >> are no operators like (), .), there is only one sentence Those aren't operators. <http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.11> <http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.12> >> about associations. I tried to create such a table Do you mean "associativity"? John B. Matthews wrote: > Sun: > <http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html> > > Princeton: > <http://www.cs.princeton.edu/introcs/11precedence/> > > University of West Florida: > <http://www.cs.uwf.edu/~eelsheik/cop2253/resources/op_precedence.html> They're pretty darn easy to find. <http://www.google.com/search?q=java+operator+precedence+table> (The UWF link is top on the list, the Sun link is second, the Princeton link fourth.) -- Lew
From: Robbo on 25 Jan 2010 07:22 > Those aren't operators. If not, why tables of operators you provided me with include () [] and . ? Look: > > Princeton: > > <http://www.cs.princeton.edu/introcs/11precedence/> > > > > University of West Florida: > > <http://www.cs.uwf.edu/~eelsheik/cop2253/resources/op_precedence.html>
From: Robbo on 25 Jan 2010 08:00
And the second thing... Here http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.12 you may find information that: "The following 37 tokens are the operators, formed from ASCII characters: Operator: one of = > < ! ~ ? : == <= >= != && || ++ -- + - * / & | ^ % << >> >>> += -= *= /= &= |= ^= %= <<= >>= >>>=" There is no information about "new" which is also operator: http://java.sun.com/docs/books/tutorial/java/javaOO/objectcreation.html "The new keyword is a Java operator that creates the object." In tables of operators http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html there is no information about "new". So, as you can see, I need GOOD table of operators, not any table of operators. |