|
-
Apr 16th, 2001, 02:48 PM
#1
Thread Starter
Addicted Member
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?
-
Apr 17th, 2001, 09:08 PM
#2
Dazed Member
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.
-
Apr 18th, 2001, 02:40 PM
#3
Hyperactive Member
Yep, dont work with dos, probably will get the a square cursor symbol if anything.
-
Apr 18th, 2001, 03:04 PM
#4
Thread Starter
Addicted Member
-
Apr 18th, 2001, 07:46 PM
#5
Dazed Member
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.
-
Apr 19th, 2001, 02:53 PM
#6
Thread Starter
Addicted Member
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.
-
Apr 20th, 2001, 12:49 PM
#7
Dazed Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|