Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Is it modify Object data? Generally Object data can't modify............but in this program it modifies.......... Why?

Have Programming Question? Ask it here!
 
 
 


Trikoti Mohan
Is it modify Object data? Generally Object data can't modify............but in this program it modifies.......... Why?
0 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners


import java.io.*; public class Conversions { public static void main(String args[]) throws Exception { int a,b; DataInputStream dis=new DataInputStream(System.in);

            //String to Fundamental conversion
    System.out.print("Enter any integer value: ");
    a=Integer.parseInt(dis.readLine());


    //Fundamental to Object conversion
    System.out.println("Before fundamental to object conversion");
    System.out.println("a+10 value: "+(a+10)+"\t\t\ta+20 value: "+(a+20));
    System.out.println("After fundamental to object conversion");
    Integer io=new Integer(a);
    io++;
    io=io+2;
    System.out.println(io);
            System.out.println("Object data is modified");


}

}


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com