Results 1 to 3 of 3
  1. #1
    p0o0o0ya is offline Member
    Join Date
    Jan 2011
    Location
    Iran-Zanjan
    Posts
    4
    Rep Power
    0

    Default a problem with objects

    Hi guys. I am new to java. I composed a program :
    Java Code:
    //: object/DemonsrateStatic
    public class DemonsrateStatic{
    	public static void main(String[ ] args){
    		class TestClass{
    			static int i;
    		}
    		TestClass test1= new TestClass( );
    		TestClass test2= new TestClass( );
    		TestClass test3= new TestClass( );
    		System.out.println(TestClass.i);		
    	`	test1.i++;
    		System.out.println(TestClass.i);
    		test2.i++;
    		System.out.println(TestClass.i);
    		test3.i++;
    		System.out.println(TestClass.i);
    		TestClass.i++;
    		System.out.println(TestClass.i);		
    	}
    }//:~
    but it doesn't work and compiler give me this error:
    E8.java:11: illegal character: \96
    ` test1.i++;
    ^
    1 error

    what's wrong with my program?!
    thanks
    Last edited by p0o0o0ya; 02-02-2011 at 08:29 AM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by p0o0o0ya View Post
    but it doesn't work and compiler give me this error:
    Java Code:
    E8.java:11: illegal character: \96
            `       (test1.i)++;
            ^
    1 error
    what's wrong with my program?!
    There's a little back-quote on that line (the caret points to it). It doesn't belong there; remove it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    p0o0o0ya is offline Member
    Join Date
    Jan 2011
    Location
    Iran-Zanjan
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Problem with Objects
    By javadam in forum New To Java
    Replies: 4
    Last Post: 01-27-2011, 11:39 PM
  2. Saving objects problem
    By BennyJass in forum Networking
    Replies: 2
    Last Post: 01-15-2011, 10:49 PM
  3. Problem with Vector of Objects
    By JavaClueless in forum New To Java
    Replies: 2
    Last Post: 11-07-2010, 03:46 AM
  4. Problem in collision between objects
    By Chetans in forum Java Gaming
    Replies: 3
    Last Post: 03-15-2010, 11:24 PM
  5. Problem Creating/implementing Objects
    By ramathews in forum New To Java
    Replies: 2
    Last Post: 02-25-2010, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •