|
Last change
on this file since 3103 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /*--------------------------------------------------------------------------*/
|
|---|
| 2 | /* File name : err2.java */
|
|---|
| 3 | /* : */
|
|---|
| 4 | /* Cause : Operator "+=" error in char,byte,short type */
|
|---|
| 5 | /* : */
|
|---|
| 6 | /* Message : err2.java: In class `err2': */
|
|---|
| 7 | /* : err2.java: In method `main(java.lang.String[])': */
|
|---|
| 8 | /* : err2.java:22: Incompatible type for `='. Explicit cast */
|
|---|
| 9 | /* : needed to convert `int' to `byte'. */
|
|---|
| 10 | /* : a %= b; */
|
|---|
| 11 | /* : ^ */
|
|---|
| 12 | /* : 1 error */
|
|---|
| 13 | /*--------------------------------------------------------------------------*/
|
|---|
| 14 |
|
|---|
| 15 | public class err2 {
|
|---|
| 16 | public static void main(String[] args) {
|
|---|
| 17 | byte a = -16;
|
|---|
| 18 | byte b = 10;
|
|---|
| 19 |
|
|---|
| 20 | a %= b;
|
|---|
| 21 |
|
|---|
| 22 | if ( a == -6 ) {
|
|---|
| 23 | System.out.println("OK");
|
|---|
| 24 | } else {
|
|---|
| 25 | System.out.println("a = " +a);
|
|---|
| 26 | }
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.