473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

java generics integer value argument

152 100+
Is there an equivalent technique for java for C++ ability to pass integer values to template arguments (e.g some<6>) ???

thanks!
Jul 1 '11 #1
3 2883
Nepomuk
3,112 Expert 2GB
It's been a while, but I think the class Integer could be what you're looking for. However, I'm just guessing at what some<6> may do in C++, haven't worked with generics in C++ much.

Greetings,
Nepomuk
Jul 2 '11 #2
Tassos Souris
152 100+
thanks Nepomuk but not exactly what i am looking for...

for example i want to make a generic Vector<dim> where the user will use it as:
Vector<2> v1;
Vector<3> v2;

this is possible in C++ but i think not in java as far as i know...
Jul 2 '11 #3
Nepomuk
3,112 Expert 2GB
Hm, I'm not aware of a feature like that in Java, no. You can always have an int in the constructor of course but that's as good as it gets for all I know.

Greetings,
Nepomuk
Jul 2 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Sashi | last post by:
Two questions: (1) I can pull the text of an XML element as a string just fine using code as such: strSomeString = myXmlDoc.SelectSingleNode("/Element1/Element2/Element3",...
22
by: hantie | last post by:
In my program, for reducing the complexity, the integer was stored as char, so 2 is stored as '2', which is decimal: 50 Is is possible for me to obtain the integer value of '2' in the program,...
1
by: Vaj | last post by:
Hi, when i'm Validating the Age TextBox like this if(txtAge.Text>125) reqage.ErrorMessage="age should be less than 125"; . I'm getting an errormessage "cannot use > to compare a string with...
5
by: Robert Wilson | last post by:
Hi, I'm a little new to C#, so bear with me. I have a text box on a form, and I want to be able to get an integer value of whats in it. In VC++ you just set the text box property to be numerals...
5
by: Joergen Bech | last post by:
Basically, I want to convert hex values in the range "00000000" to "FFFFFFFF" to a signed, 32-bit Integer value. In VB6, I could just write lngValue = Val(hexstring$). In VB.Net, I seem to be...
8
by: Alex Fraser | last post by:
Can negating a non-negative signed integer value ever overflow? Put another way, can it be true that (mathematically) INT_MIN > -INT_MAX, LONG_MIN > -LONG_MAX etc? I know that typically it can't...
8
by: Polaris431 | last post by:
I have a buffer that holds characters. Four characters in a row represent an unsigned 32 bit value. I want to convert these characters to a 32 bit value. For example: char buffer; buffer =...
2
by: fredb | last post by:
I am trying to retrieve an integer value that is returned from an MS SQL function that our DBA wrote and is saved in a table in the database. Using the ODBC_EXEC command I am able to successfully...
6
by: phpmagesh | last post by:
Hai friends, {$PRODUCTS_PRICE} This is my variable i dont know why they used { } for that. in that product_price i m storing a integer value like 112.00 etc.., when i change to another radio...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.