Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #3196 > unrolled thread
| Started by | 12030122061@sicsr.ac.in |
|---|---|
| First post | 2015-03-09 05:22 -0700 |
| Last post | 2015-03-13 22:41 -0700 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.lang.java.help
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
| From | 12030122061@sicsr.ac.in |
|---|---|
| Date | 2015-03-09 05:22 -0700 |
| Subject | need hlp |
| Message-ID | <f3168b74-7480-4c9f-8401-2f0e37a8ec8c@googlegroups.com> |
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);
}
--
*This email is governed by the Disclaimer Terms of SIU which may be viewed
at* http://www.siu.edu.in/downloads/email-disclaimer.php
[toc] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2015-03-09 09:44 -0400 |
| Message-ID | <mdk822$ds8$1@dont-email.me> |
| In reply to | #3196 |
On 3/9/2015 8: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);
> }
What is your question? What "hlp" do you need? All I
see here is a bunch of Java-like-but-not-Java garble, with
no description of what you want it to do. I'm a programmer,
not a mind reader.
--
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-03-09 11:12 -0400 |
| Message-ID | <mdkd79$42o$1@dont-email.me> |
| In reply to | #3196 |
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());
}
}
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2015-03-13 22:41 -0700 |
| Message-ID | <e232864e-335c-423d-a3d8-b6cd8464ec1b@googlegroups.com> |
| In reply to | #3196 |
Read the Java Tutorials for the basic rules of the language. Statements belong inside methods, and a standalone declaration inside 'main()' doesn't help anything. Try a simpler example until you get used to it.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.help
csiph-web