C++ Learning Community Forum
August 01, 2010, 03:00:09 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Hello.
Home
Help
Search
Login
Register
C++ Learning Community Forum
>
General C++ Programming
>
C++ in General
>
A queation about templates
Pages: [
1
]
« previous
next »
Print
Author
Topic: A queation about templates (Read 615 times)
FrozenKnight
ASM Freak
Global Moderator
Dr. of C++ology
Posts: 546
Do it yourself it's the only way to learn.
A queation about templates
«
on:
May 18, 2009, 09:01:34 AM »
I was just wondering, as most of you know i have little to no experience with templates.
Anyway, I just recently took a course on java and I was wondering what the differences between java's abstract classes and C++ templates are?
Logged
Imagine the impossible, then make it happen.
C-Man
Does anyone even read this ?
Global Moderator
Dr. of C++ology
Posts: 988
Re: A queation about templates
«
Reply #1 on:
May 18, 2009, 10:18:41 AM »
I have little to no knowlage of jave
Logged
Please comeby #coding
,
#coding stats
kccc
I think we have an answer to C-Man's question in his title.
Geek
Posts: 147
Re: A queation about templates
«
Reply #2 on:
May 18, 2009, 11:35:02 AM »
No. Abstract methods of abstract classes in Java are simply declarations and still have to have precise signatures (abstract int hit(); there's no way of having one return anything else than int if you specify int), but will not be defined in the super class. You must subclass them. Almost exactly like abstract classes in C++ methinks.
Logged
mleveill
1337 L0LCoder
C++ Freak
Posts: 430
IM IN UR PROGRAMZ WRITIN UR CODEZ!
Re: A queation about templates
«
Reply #3 on:
May 20, 2009, 04:51:50 AM »
i think you should be comparing java's generics and c++'s templates
i don't think either of them are implemented all that well
Logged
Quote from: kohlrak
Common interests aren't always the best thing. Especially programming wise.
I could just picture a couple fighting over weather to "xor eax by eax" or "and eax by 0"...
Then kids'll come home and argue with their parents that readabilty is better than size and that "mov eax, 0" would be best because that's "more readable." (Even if it really isn't...)
LOLCode -
http://lolcode.com/home
myork
Global Moderator
C++ guru
Posts: 1147
Re: A queation about templates
«
Reply #4 on:
May 21, 2009, 04:26:04 PM »
C++ has abstract classes.
Just create a class with pure virtual function.
Templates are a very advanced form of Java Generics.
Generics basically covers what templates was originally conceived to-do before everybody realized that templates was really a Turing complete mete-language and much more powerful than originally expected.
Logged
shash4evr
Nerd
Posts: 74
Re: A queation about templates
«
Reply #5 on:
May 25, 2009, 04:21:28 PM »
there is no relation between java abstract classes and the c++ templates. Abstraction is a concept in OOP and c++ templates are basically similar to functionality of the java collection classes.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General C++ Programming
-----------------------------
=> C++ Help
===> C Programming
=> C++ Tips
=> C++ in General
=> 3rd Party Libraries Programming
-----------------------------
Platform Specific Programming
-----------------------------
=> Windows
=> Linux
=> DirectX
=> OpenGL
-----------------------------
C++ Creations
-----------------------------
=> Finished Products
=> Work in Progress
-----------------------------
Resources
-----------------------------
=> Recommended Resources
=> Bookworm's Corner
===> Accelerated C++: Practical Programming by Example
===> Code Complete
-----------------------------
Other than C++....
-----------------------------
=> Off Topic
=> Other Programing Languages
===> ASM Programming
=> Computer Lab
=> The Community
Loading...