Syvum Home Page

Home > Discussions > For all activities

Discussion topic: Contributed Answer/Explanation to Q. 1

Viewing messages

To go to the homepage of this topic, click here.
<  Page 2 of 11  >  >>
From: diwu_sharmaReply 21 of 205Reply
Subject: Contributed Answer/Explanation to Q. 8
   type casting:
   
   type casting is a phenomenon in java by which we can fit a value of a
   datatype into another datatype.It is of two types:
   
   
   1)Automatic type casting
   
   
   in this type,when we have to fit a lower datatype into a higher datatype,the
   system on its own does it.eg:
   
   
    int a=5;
   
   
   double b=a;
   
   
    
   
   
   2)Conversion type casting
   
   
   in this type,a higher data type is to be fitted in lower data type.it should
   be done manually.if not done so,we will get an error as 'possible loss of
   precision'.
   
   
   eg.:
   
   
   double a=5;
   
   
   int b=(int)(a); 

Posted at: Thu Jan 7 07:22:10 2010 (GMT)

From: diwu_sharmaReply 22 of 205Reply
Subject: Contributed Answer/Explanation to Q. 12
   operators:
   = is a assignment operator while == is a relative operator

Posted at: Thu Jan 7 07:23:53 2010 (GMT)

From: cuteritu_1994Reply 23 of 205Reply         View replies (1)
Subject: Contributed Answer/Explanation to Q. 25
   import java.io.*;

Posted at: Tue Jan 12 04:36:05 2010 (GMT)

From: cuteritu_1994Reply 24 of 205Reply
Subject: Contributed Answer/Explanation to Q. 25
   program
   
   import java.io.*;
   
   
   class salary
   
   
   {
   
   
   int ph,msal;
   
   
   double it;
   
   
   String name,add,sub;
   
   
   public static void main(String args[]) throws IOException
   
   
   {
   
   
   salary obj=new salary();
   
   
   obj.accept();
   
   
   obj.display();
   
   
    obj.compute();
   
   
   }
   
   
   }
   
   
   InputStreamReader g=new InputStreamReader(System.in);
   
   
   BufferedReader h=new BufferedReader(g);
   
   
   name=h.readLine();
   
   
   add=h.readLine();
   
   
   sub=h.readLine();
   
   
   String x1=h.readLine();
   
   
   ph=Integer.parseInt(x1);
   
   
   msal=Integer.parseInt(x1);
   
   
   it=Integer.parseInt(x1);
   
   
   }
   
   
   void display()
   
   
   {
   
   
   System.out.println(name"" address""subspec);
   
   
   System.out.println(phone""monthly salary);
   
   
   }
   void compute()
   
   
   {
   
   
   int ann=msal*12;
   
   
   if(ann>175000)
   
   
   {
   
   
   it=0.05*ann;
   
   
   else
   
   
   it=0;
   
   
   System.out.println(it);
   
   
   }
   }

Posted at: Tue Jan 12 04:44:26 2010 (GMT)

From: ishan20Reply 25 of 205Reply
Subject: Contributed Answer/Explanation to Q. 22
   true

Posted at: Thu Jan 14 14:38:10 2010 (GMT)

From: ishan20Reply 26 of 205Reply
Subject: Contributed Answer/Explanation to Q. 22
   true

Posted at: Thu Jan 14 14:38:22 2010 (GMT)

From: ishan20Reply 27 of 205Reply
Subject: Contributed Answer/Explanation to Q. 22
   true  ;false; false; true

Posted at: Thu Jan 14 14:39:21 2010 (GMT)

From: aishugkReply 28 of 205Reply
Subject: Contributed Answer/Explanation to Q. 22
   HiequalsHi->true

Posted at: Mon Jan 18 11:46:08 2010 (GMT)

From: aishugkReply 29 of 205Reply
Subject: Contributed Answer/Explanation to Q. 23
   -22

Posted at: Mon Jan 18 11:51:42 2010 (GMT)

From: aishugkReply 30 of 205Reply
Subject: Contributed Answer/Explanation to Q. 24
   8

Posted at: Mon Jan 18 11:54:23 2010 (GMT)

From: mylife12Reply 31 of 205Reply
Subject: Contributed Answer/Explanation to Q. 1
   applets and applications these are the two types

Posted at: Fri Jan 22 16:29:43 2010 (GMT)

From: mylife12Reply 32 of 205Reply
Subject: Contributed Answer/Explanation to Q. 2
   A variable which belongs to an object is  is called its instance variable

Posted at: Fri Jan 22 16:33:53 2010 (GMT)

From: mylife12Reply 33 of 205Reply
Subject: Contributed Answer/Explanation to Q. 3
   in binary search we have to sort the array while in linear search there is
   no neccesity to sort out the array

Posted at: Fri Jan 22 16:35:27 2010 (GMT)

From: mylife12Reply 34 of 205Reply
Subject: Contributed Answer/Explanation to Q. 4
   double a= 3.14
   
   As in java the real numbers are indicated by double or float

Posted at: Fri Jan 22 16:38:28 2010 (GMT)

From: mylife12Reply 35 of 205Reply         View replies (1)
Subject: Contributed Answer/Explanation to Q. 5
   the example is
   <p>
   {
   </p>
   <p>
     if(dist<100)
   </p>
   <p>
       amt= dist*4;
   </p>
   <p>
     else if(dist>100 && dist<1100)
   </p>
   <p>
       amt= 400 + (dist-100)*10;
   </p>
   <p>
     else
   </p>
   <p>
       amt= 400 + 1000 + (dist-1100)*15
   </p>

Posted at: Fri Jan 22 16:44:21 2010 (GMT)

From: mylife12Reply 36 of 205Reply
Subject: Contributed Answer/Explanation to Q. 5
   the example is
   <p>
   { 
   </p>
   <p>
     if(dist<100) 
   </p>
   <p>
       amt= dist*4; 
   </p>
   <p>
     else if(dist>100 && dist<1100) 
   </p>
   <p>
       amt= 400 + (dist-100)*10; 
   </p>
   <p>
     else 
   </p>
   <p>
       amt= 400 + 1000 + (dist-1100)*15;
   </p>
   <p>
   }
   </p>

Posted at: Fri Jan 22 16:44:43 2010 (GMT)

From: mylife12Reply 37 of 205Reply         View replies (1)
Subject: Contributed Answer/Explanation to Q. 6
   formal parameter are the parameter which is defined already defined and
   actual parameters which are defined or stated by the user

Posted at: Fri Jan 22 16:53:52 2010 (GMT)

From: mylife12Reply 38 of 205Reply
Subject: Contributed Answer/Explanation to Q. 6
   formal parameter are the parameter which is	already defined in a class
   while actual parameters which are defined or stated by the user in a class
   actual parameters are the arguments on the program given by the user for the
   working of the program

Posted at: Fri Jan 22 16:55:52 2010 (GMT)

From: mylife12Reply 39 of 205Reply
Subject: Contributed Answer/Explanation to Q. 9
   lang is a package that is invoked by default 

Posted at: Fri Jan 22 16:58:17 2010 (GMT)

From: mylife12Reply 40 of 205Reply         View replies (2)
Subject: Contributed Answer/Explanation to Q. 7
   we need constructors as

Posted at: Fri Jan 22 16:58:49 2010 (GMT)

<  Page 2 of 11  >  >>

To post to this forum, you must be signed in as a Syvum member. Please sign in / register as a member.

Contact Info © 1999-2024 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright