Results 1 to 7 of 7

Thread: Symbol Not Displaying

  1. #1

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    How can I get the '£' symbol to show up when I execute my Java program, the program runs under command prompt it's not a GUI program.

    Also is there a char/ascii kind of functions/methods or somthing in Java?

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    I dont think you can print characters in DOS
    i tried a long time ago and was unsucessful.

    class unicodetest {
    public static void main(String[] args){

    System.out.println('\u22ff');

    }
    }


    Java uses unicode character set which
    is just nothing more than a backshlash
    followed by four hexadecimal characters.

    Goto www.unicode.org to view the
    character sets. Im sure you can print
    any character you want out to a file via
    a stream but i dont think it will work
    through DOS.

  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Yep, dont work with dos, probably will get the a square cursor symbol if anything.

  4. #4

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    I tried it and I get ? come up even if I type different codes.

    Java is a pain in the ASS it's f*****g long winded!!!

    It's ment to be one of the most modern and powerfull languages yet it complicates the simplest of tasks. With Pascal or VB I had no problem printing symbols and characters.

    Any way:

    THANKS FOR YOUR HELP GUYS

  5. #5
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    yeah all i got too was the ? symbol.

    With any higher level of power there is going to
    be some type of complication when programming
    Look at C++..... I dont think you can program in
    anymore of a pain in the ass lanugages than that.

    I was a C++ programmer for a while but i made
    the switch because C++ in my opinion is too error
    prone.

  6. #6

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    Your Joking , I was hoping C++ would be a bit better I mean part of Java is derived from that, but really thought C++ would be better to study.

    I've just entered Specialist Programming C++ as one of my modules for next year.

    Oh well, there is always something to gain.

    Were you using IDE to write C++ code or notepad or something?

    Doesn't the IDE's make life a bit simpler? I know VB one did well at least for my mates and me.

  7. #7
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    I took C++ in school and after working with Java
    i perfer it much better. We had to do a car simulator in school and with C++ is was a pain in the A@%
    These are some of the diffrences between Java and C...... that you will come across


    No preprocessor directives: Java treats constant definitions as
    static final fields.

    No global variables: Java defines an extreamly clean namespace.Packages contain classes, classes contain methods and fields methods contain variables. Thus there is no possibility for namespace collisions.

    Well-defined primative type sizes:
    All the primative types in Java have well defined sizes. In C, the size of int, short ,long types is platform dependent, which hampers portability.

    Foward References: The Java compiler is smarter then the C compiler in it allows methods to be invoked before being defined. This elimates the need
    to define function in a header file before defining them in a program file, as is done in C.

    No method pointers: C allows the programmer to store the addres of a function in a variable and pass that function pointer to other functions. You cannot do this with java methods but you can acheive similiar results by passing an object that implements a particular interface.

    Variable declarations anywhere: C only permitts local variable declarations to be at
    the beginning of a method or block. Java allows the variable declarations anywhere
    within a method or block. --NOTE-- most programmers perfer to keep variable
    declarations at the top of a block or method however.

    Garabage Collection: The Java Virtual Machine performs "Garabage Collection" or
    deallocation of memory automatically. This elimates the need for Java programmers to
    explictly manage memory used by all object and arrays. For instance an object is eligible for garabage collection if there are nolonger any variables that hold a
    refrence to that object.

    Method overloading: Java programs can define multiple methods with the same name
    as long as the methods have diffrent parameter lists.

Posting Permissions

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



Click Here to Expand Forum to Full Width