Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #3198
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.java.help |
| Subject | Re: need hlp |
| Date | 2015-03-09 11:12 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <mdkd79$42o$1@dont-email.me> (permalink) |
| References | <f3168b74-7480-4c9f-8401-2f0e37a8ec8c@googlegroups.com> |
On 03/09/2015 08:22 AM, 12030122061@sicsr.ac.in wrote:
> class total
> {
> int a;
> int b;
> int c;
> int d;
> int e;
> }
> public class demo{
> public static void main (Sring args[])
> {
> int sum;
> }
> total b1 = new total();
> b1.a = S[0];
> b1.b = S[1];
> b1.c = S[2];
> b1.d = S[3];
> b1.e = S[4];
> x = a+b+c+d+e;
> b1.a = integer parseInt (a);
> b2.b = integer parseInt (b);
> b3.c = integer parseInt (c);
> b4.d = integer parseInt (d);
> b5.e = integer parseInt (e);
> System.out.println(x);
> }
>
package scratch;
import java.util.Random;
public class Total {
private int a, b, c, d, e;
private static Random rnd = new Random();
/**
* Constructs a Total instance with random instance variables.
*/
public Total() {
}
/**
* Parses a String array to initialize the Total instance variables.
*
* @param S
* an array of Strings representing five integers.
*/
public Total(String[] S) {
}
/**
* Sums this Total instance variables.
*
* @return the sum of this Total's instance variables.
*/
public int sum() {
int x = a + b + c + d + e;
return x;
}
}
******************************************************
package scratch;
public class TotalDemo {
public static void main(String[] args) {
System.out.println(new Total(args).sum());
}
}
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar
need hlp 12030122061@sicsr.ac.in - 2015-03-09 05:22 -0700 Re: need hlp Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-03-09 09:44 -0400 Re: need hlp Jeff Higgins <jeff@invalid.invalid> - 2015-03-09 11:12 -0400 need hlp Lew <lewbloch@gmail.com> - 2015-03-13 22:41 -0700
csiph-web