What is the need to create an object representation for primitive data types?
  1. Primitive data types such as int,char and so on are not part of the object hierarchy
  2. Primitive data types are passed by value not passed by reference.
  3. Two methods cannot refer to the same instance of an int.
  What is the result of attempting to compile and run the program?

 class A{
   public void m1(Integer i1,Integer i2){
   System.out.println("i1*i1 = "+i1*i1);
   System.out.println("i1*i2 = "+i1.intValue()*i2);
 class program1{
   public static void main(String args[]){
   A ob=new A();

Click here for correct answer

Copyright 2016 langobjects.com