See Also:
SecurityManager.checkPermission(java.security.Permission),
RuntimePermission
-Original Message-
From: ShriKant Vashishtha [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 12:28 AM
To: [EMAIL PROTECTED]
Subject: Offbeat.A Java question.
Hi
]]
Sent: Tuesday, January 15, 2002 4:05 AM
To: [EMAIL PROTECTED]
Subject: A java question.
class test {
static boolean check;
public static void main(String args[]) {
int i;
if(check == true)
i=1;
else
i=2;
if (check == false
Hi,
Is there any API existing which can trap the standard errors and can
display on demand. I am using an IBM API which sends the errors to
stderr which I want to trap and show to the client on demand.
Many Thanks,
-ShriKant
Say what?!? I've written tons of Java applications that have more than
one public class.
I think he meant if you have more than one class in your FILE then only
one of them can be public.
===
To unsubscribe: mailto
: Re: A java question.
I suppose that you mean:
Rule No. 999 in Java: if you have more than one class per source file, ...
Chen Chao wrote:
Rule No. 1 in Java: if you have more than one class in your
application, you only can use public key word in the class which has
main method
class xyz {
static int i;
public static void main(String args[]) {
while (i 0) {
i--;
}
System.out.println(i);
}
}
why it come out 0? I guess variable i has not have been initialized, so i--
will not be processed.
Franco
: (03) 9221 4106
Mobile: 0409 556 478
Fax:(03) 9941 4295
-Original Message-
From: Miao, Franco CAWS:EX [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday,15 January 2002 8:33
To: [EMAIL PROTECTED]
Subject: A java question.
class xyz {
static int i;
public static void main
the value of i.
5. Exit
(*Chris*)
- Original Message -
From: Miao, Franco CAWS:EX [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 14, 2002 1:32 PM
Subject: [JSP-INTEREST] A java question.
class xyz {
static int i;
public static void main(String args
I didn't realize i will be initiated as 0 if it is not be specified, so
you guys mean i=0 is system default?
Apparently so. I wouldn't have believed it but it just worked, under JDK
1.3.1 on Windows 2000. The following code outputs 0.
public class NotInit
{
static int i;
Phone: (03) 9221 4106
Mobile: 0409 556 478
Fax:(03) 9941 4295
-Original Message-
From: Miao, Franco CAWS:EX [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday,15 January 2002 9:00
To: [EMAIL PROTECTED]
Subject: Re: A java question.
I didn't realize i will be initiated as 0
class test {
static boolean check;
public static void main(String args[]) {
int i;
if(check == true)
i=1;
else
i=2;
if (check == false)
i=2; i=i+2;
else
i = i + 4;
System.out.println(i);
Title: RE: A java question.
You can use "{" and "}" to create blocks.
Really some of these java questions can be answered quicker if you get a reference manual (like the Java in a Nutshell book)
-Original Message-
From: Miao, Franco CAWS:EX [mailto:[EMAIL PROT
if (check == false)
{
i = 2;
i = i + 2;
}
else
i = i + 4;
-Original Message-
From: Miao, Franco CAWS:EX [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 5:35 PM
To: [EMAIL PROTECTED]
Subject: A java question.
class test {
static boolean check
: (03) 9221 4106
Mobile: 0409 556 478
Fax:(03) 9941 4295
-Original Message-
From: Miao, Franco CAWS:EX [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday,15 January 2002 9:35
To: [EMAIL PROTECTED]
Subject: A java question.
class test {
static boolean check;
public static void
if (check == false)
{i = 2; i = i + 2}
else
i = i + 4;
won't work. ( ) won't work too.
Franco
-Original Message-
From: Joe Cheng [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 2:43 PM
To: [EMAIL PROTECTED]
Subject: Re: A java question.
if (check
look at your code... i=i+2(;) Syntax baby
-Original Message-
From: Miao, Franco CAWS:EX [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 3:12 PM
To: [EMAIL PROTECTED]
Subject: Re: A java question.
if (check == false)
{i = 2; i = i + 2}
else
i = i + 4
;
}
System.out.println(i);
}
}
Franco
-Original Message-
From: Chip Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 3:14 PM
To: [EMAIL PROTECTED]
Subject: Re: A java question.
look at your code... i=i+2(;) Syntax baby
-Original Message-
From: Miao
hi,
please enclose in braces the lines i=2; i=i+2; (sans quotes) in your
code. (see below)
class test {
static boolean check;
public static void main(String args[]) {
int i;
if(check == true)
i=1;
else
i=2;
if (check ==
Rule No. 1 in Java: if you have more than one class in your application, you only can use "public" key word in the class which has main method (public static void main( ) ...). Try the following code and name your file as Test2.java (not Test.java):
class Test implements Runnable { // remove
Say what?!? I've written tons of Java applications that have more
than one public class.
At 12:02 PM 1/13/2002 -0500, you wrote:
Rule No.
1 in Java: if you have more than one class in your application, you only
can use public key word in the class which has main method
(public static void
I
think the poor chap was confused. If you can only have one public class, what
the hell is the JavaBean spec trying ot say? I mean, how would all those public
getter/setter methods be possible?
-Original Message-From: Robert Burdick
[mailto:[EMAIL PROTECTED]]Sent: Sunday,
I suppose that you mean:
Rule No. 999 in Java: if you have more than one class per source file,
...
Chen Chao wrote:
Rule No.
1 in Java: if you have more than one class in your application, you only
can use "public" key word in the class which has main method (public static
void main( ) ...).
: Monday, January 14, 2002 4:35 AM
Subject: Re: A java question.
That would be because Getters and Setters are public methods
rather than
classes.. no? It seems the original post was pointing out
that there can be
only one public class which calls the main method.
Tref Gare
Web Developer MCSD
public class Test implements Runnable {
public void run() {
for (int i=1; i=10; i++){
System.out.println(Test:+i);
}
}
}
class Test2 {
public static void main (String args[]){
Test te = new Test();
Thread t = new Thread(te);
t.start();
}
}
C:\java Greebo
Exception in thread main
Try the below (im presuming that your original code was In a file called
Test.java. The class that contains the main method must be named the same as
the Filename (i.e class Test = Test.java).
class Test {
public static void main (String args[]) {
Test2 te = new Test2();
Hi,
This is easy:
Look at the values of p and t only
p=1 = t becomes 1
p=2 = t becomes 2
p=3 = t becomes 3
p=4 = t becomes 4
p=5 = for-loop stops
1. public class TeSet {
2.public static void main(String args[]) {
3. int m = 2;
4. int p = 1;
5. int t = 0;
6. for(;p
05, 2002 11:45 PM
To: [EMAIL PROTECTED]
Subject: Re: A Java question
opps my bad~
If you ever want to know how your algorithm became to be, try inserting some
System.out.println(algorithmcalculations);
or
out.println(algorithmcalculations);
Then you will see how the values added etc
of x 3
etc
etc
After my example you don't understand what I am talking about, I suggest
taking a course or buying a book
- Original Message -
From: Miao, Franco CAWS:EX [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 06, 2002 7:27 PM
Subject: Re: A Java question
]
Subject: Re: A Java question
No, when you do a system.out.println();
In your ide, your suppose to see the print statements, thus leading you how
the program exe each iteration of the algorithmn, giving you clues how the
program becuase to be.
So for example
if my program is this
int m
the branch is taken or not.
-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Miao, Franco CAWS:EX
Sent: Sunday, January 06, 2002 7:28 PM
To: [EMAIL PROTECTED]
Subject: Re: A Java question
tried
To: [EMAIL PROTECTED]
Subject: Re: A Java question
No, when you do a system.out.println();
In your ide, your suppose to see the print statements, thus leading you how
the program exe each iteration of the algorithmn, giving you clues how the
program becuase to be.
So for example
if my program
PROTECTED]
Subject: Re: A Java question
Because the p++ is compared before the increment, that is why p can be
equals to
5 (4 is less tha 5, and increment 4 to 5). As for t, even the comparison of
t++
with m fails , but the value of t still increase after the comparison. As
for m,
when the value
: Miao, Franco CAWS:EX [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 07, 2002 6:41 AM
Subject: Re: A Java question
int p = 1;
for(;p 5;p++)
the p++ is compared before the increment what do u mean?
P=1 then start
unlimited loop until p5, which is 4, so it is turn to run P++, P=P+1
(P=4
1. public class TeSet {
2.public static void main(String args[]) {
3. int m = 2;
4. int p = 1;
5. int t = 0;
6. for(;p 5;p++) {
7.if(t++ m) {
8. m = p + t;
9.}
10. }
11. System.out.println(t equals + t);
12.}
13. }
]
Sent: Sunday, January 06, 2002 2:30 AM
Subject: A Java question
1. public class TeSet {
2.public static void main(String args[]) {
3. int m = 2;
4. int p = 1;
5. int t = 0;
6. for(;p 5;p++) {
7.if(t++ m) {
8. m = p + t;
9.}
10
PROTECTED]
Sent: Sunday, January 06, 2002 2:43 AM
Subject: Re: A Java question
If you ever want to know how your algorithm became to be, try inserting
some
System.out.printlnalgorithmcalculations);
or
out.printlnalgorithmcalculations);
Then you will see how the values added etc
Yep. The shift is bits, so the 0x0010 must be interpreted as
0001
Thus the result of the right shift operation is
0x0001
At 10:22 PM 12/29/2001 -0800, you wrote:
0x0010 4 = ?
need to convert hex to binary first or what?
thanks.
Franco
: Simple java question
float i = 1.715
result = Math.floor(( i * 100.0 ) + 0.5) / 100.0
- Original Message -
From: Alireza Nahavandi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 21, 2001 3:59 PM
Subject: Simple java question
Hi All,
How can I round up a float number
Hi All,
How can I round up a float number in java like 1.715 to 1.72
Thank you.
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
float i = 1.715
result = Math.floor(( i * 100.0 ) + 0.5) / 100.0
- Original Message -
From: Alireza Nahavandi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 21, 2001 3:59 PM
Subject: Simple java question
Hi All,
How can I round up a float number in java like
PROTECTED]]On Behalf Of Deniz Ersöz
Sent: Friday, May 05, 2000 3:44 PM
To: [EMAIL PROTECTED]
Subject: Java Question
Hi,
I cannot run jfc applets on IE5, it can't found the classes...
Anyone got any idea?
Thank u for your help
==
41 matches
Mail list logo