Results 1 to 7 of 7

Thread: Changing the entity of a datatype

  1. #1
    Join Date
    Dec 2010
    Posts
    66

    Changing the entity of a datatype

    I am a looking forward to be a programmer, I have gone through this forum and came to know apart from solving the technical queries this forum helps a lot in solving the queries that are based on programs and codes , so i too decided to post my query in this forum. I want to know if there is any way that will help me in changing the data types and there entities, I would strongly recommend that a programmer or a developer responds to this question.

  2. #2
    Join Date
    May 2009
    Posts
    529

    Re: Changing the entity of a datatype

    I think you are talking about the type conversion or the typecasting in the programming languages if I am not wrong, this means to change the entity of a data type to other, but this may lead in a data loss , that is if you attempt to convert a value stored as an float such as 5.32 into integer then it will just show the value as 5 , discarding the decimal portion , but you can do the reverse operation quite easily without the data loss.

  3. #3
    Join Date
    May 2009
    Posts
    543

    Re: Changing the entity of a datatype

    In the field of computer science, the terms type conversion, typecasting, and and there is one more term coercion means in different ways of, totally or openly, altering an entity of one data type into some other. This is done to in order to take benefit of some characteristic of type hierarchies or type illustration. One instance I can tell you as the above mentioned example small integers, which can be stored in a compressed format and changed to a larger representation when used in mathematical calculations computations. In object-oriented programming concept , type conversion permits programs to treat objects of one kind as one of their predecessor types to make simpler communicating with them.

  4. #4
    Join Date
    May 2009
    Posts
    511

    Re: Changing the entity of a datatype

    This is significant for the type conversion in developing any software. If you will store a integer value into a byte variable directly, this will be illicit operation. For storing your calculated integer value in a byte identifier you will have to alter and modify the type of resultant data which has to be stored in a new data type , there are mostly of two types , one is of implicit conversion and the other is explicit.

  5. #5
    Join Date
    May 2009
    Posts
    637

    Re: Changing the entity of a datatype

    Typecasting is also used in mathematical operation to derive accurate results. This is very much required in case of division when an integer data type stored value is divided by some other and you do not wish to take the remainder part omitted. In order to get correctness in the value, a programmer can make use of typecast as illustrated in the example below .
    Code:
    main() 
    { 
    float i; 
    i = (float)6 / 4; 
    }

  6. #6
    Join Date
    Apr 2009
    Posts
    488

    Re: Changing the entity of a datatype

    Every operation programmed in the Java developing language has a kind that can be concluded from the structure of the operation and the sorts of the literals, variables, and functions specified in the expression. It is achievable, however, to code an expression in a subject where the kind of the expression is not suitable. In a few scenarios, this tends to an error while compilation. In other scenarios, the context might be capable of accepting a type that is relevant to the kind of the expression; as a ease, rather than requiring the developer to point out a type conversion clearly, the language acts upon an implicit conversion from the category of the expression to a category suitable for its surrounding environment. There are certain conversions such as from type S to type T that permits an expression which is of S type to be considered during compilation time taking it as of type T instead. In some scenarios this will need a equivalent action during run time to verify the validation of the conversion or to decode the run-time worth of the expression into a state suitable for the type T.

  7. #7
    Join Date
    Apr 2009
    Posts
    569

    Re: Changing the entity of a datatype

    Whenever you are converting from a type object to a thread type , then it will need a run time value check, to ensure that the value that is derived during the run time must be the instance of either the Thread class or its one of the child class. There is a possibility that it may result in a state that you will have to throw the exception that crosses the boundary limit and will have to catch that exception with suitable exception handling technique.Whenever you are attempting to do anything in the reverse of the above conversion then you will have to make sure that the value produced at the run time after the execution of the thread type expression then it should be the a applicable reference of the Object type.When you are attempting to convert any value that of the type integer to a type long then it is actually converting a value stored in a 32 bit variable to a 64 bit variable i.e in long, so you can do it quite easily as there is no data loss. I t will not throw any sort of exception , it will not result into any sort of data loss either.If you trying to convert the value the value that is stored as double to the type long, since both the data types holds the equal number of space i.e 64 bit , this sort of conversion requires a no trivial translation in order to perform the desired task, , so to determine whether there will be the data loss or not depends on the actual value produces during the runtime.

Similar Threads

  1. Change double datatype in parameter
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 08-03-2010, 09:24 AM
  2. BLOB datatype in oracle database
    By Garlands in forum Software Development
    Replies: 4
    Last Post: 10-02-2010, 10:53 PM
  3. Entity Referencing
    By Bhardwaj in forum Software Development
    Replies: 5
    Last Post: 20-01-2010, 08:48 AM
  4. C# timestamp datatype
    By Mehraj in forum Software Development
    Replies: 3
    Last Post: 04-08-2009, 06:58 PM
  5. DataType Decimal or double for Currency?
    By ArunJ in forum Software Development
    Replies: 4
    Last Post: 14-02-2009, 06:54 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,929,121.24212 seconds with 17 queries