473,395 Members | 1,348 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,395 software developers and data experts.

Urgent:Is int an object

What is int primitive type.

Are primitive types like int , char , float are object. This is
question asked to me? Can any one help me?

Regards
Krish.
Jul 19 '05 #1
4 5176
>What is int primitive type.

Are primitive types like int , char , float are object. This is
question asked to me? Can any one help me?


They are definitively not objects, nor really classes. They are
primitive types, that`s it.

The only thing which makes them look like classes is the
constructor-like call :

int i = int();

which initializes 'i' to 0. This case was meant for simplifying
templates.

Variables having, for example, type 'int', are usually referred to as
'variables', not objects, but it does not hurt calling them like that
I suppose.
Jonathan

Jul 19 '05 #2

"krish" <kr*******@hotmail.com> wrote in message
news:36**************************@posting.google.c om...
What is int primitive type.

Are primitive types like int , char , float are object. This is
question asked to me? Can any one help me?

Regards
Krish.


What is the definition of object? You can define object so that an int is an
object, you can define object so that int is not an object. So your question
is very hard to answer unless you explain what you understand by the term
'object'.

john
Jul 19 '05 #3
Rolf Magnus wrote:
Jonathan Mcdougall wrote:

What is int primitive type.

Are primitive types like int , char , float are object. This is
question asked to me? Can any one help me?


They are definitively not objects, nor really classes. They are
primitive types, that`s it.

The only thing which makes them look like classes is the
constructor-like call :

int i = int();

which initializes 'i' to 0. This case was meant for simplifying
templates.

Variables having, for example, type 'int', are usually referred to as
'variables', not objects, but it does not hurt calling them like that
I suppose.

In C++ standard terminology (which is what matters here), everything
that occupies storage is an object.


<AR nit>
.... except for functions, of course. IOW, the code for a given function
occupies storage; but according to the C++ object model, that code
(i.e., that function) is not considered an object.
</AR nit>

--
Jim

To reply by email, remove "link" and change "now.here" to "yahoo"
jfischer_link5809{at}now.here.com
Jul 19 '05 #4
"krish" <kr*******@hotmail.com> wrote in message
news:36**************************@posting.google.c om...
What is int primitive type.

Are primitive types like int , char , float are object. This is
question asked to me? Can any one help me?


Types are not objects, so int, char etc. are not objects. User-defined
classes are also types and are not objects. You get an object when you
create an instance of a type, so an int is an object, a char is an object,
etc.

DW

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lindy | last post by:
I have a schema file called asc.xsd which I have added to my project .Net project (VB). I am using XMLTextWriter in order to create/write data to a new XML file. Is there a way to access the...
0
by: TP | last post by:
Has anyone used db2 7.2 on z/os and also doesn't this version provide functions such as row_number() over (...) for developers to implement pagination or records per page? Please let me know,...
8
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error for some of my web application users but not others??? Even though the application runs from a central webserver??? Thanks for...
1
by: AVL | last post by:
Hi I'm working on indexing a website. I want to restict the search to only few file types like .doc,.txt and.ppt How to specify the file types in the 'ixsso.Query' object Presently i'n using...
13
by: Niyazi | last post by:
Hi I have a report that I have to run it monthly in my machine. My code in VB.NET and I access AS400 to get data, anaysie it and send into pre formated Excel sheet. The data consist of 9000...
3
by: ricolee99 | last post by:
Hi everyone, I have a problem that i have been trying to solve for awhile. I'm given a code where the purpose is to create a general dataset mapper. Given any dataset, i have a class,...
3
by: optionsindia | last post by:
hi partners, we are having a urgent requirement for one of our client cmmi level5 company in hyd if u intrested Kindly mail your responses to gangadhar.sadhu@optionsindia.com Project Lead -...
77
by: Hans Schneider | last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); }
2
by: muddasirmunir | last post by:
I had recived teh following mail in my yahoo account today , please confirm me is it fake or real , what to do, the mail is Account Alert Dear Valued Member, Due to the congestion in...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.