Search Results

Showing results 1 to 15 of 15
Search took 0.00 seconds.
Search: Posts Made By: PopeJareth ; Forum: Java and child forums
Forum: Java Sep 17th, 2009
Replies: 8
Views: 794
Posted By PopeJareth
The class that contians 'public static void main' must have static declared for all methods contained.

so your code should look like this...

public class Pay
{public static void main(String[]...
Forum: Java Sep 16th, 2009
Replies: 3
Views: 374
Posted By PopeJareth
I have used "\t" to tab over to a lined up position. That could be an option for you.
Forum: Java Aug 21st, 2009
Replies: 3
Views: 339
Posted By PopeJareth
char first = myString.charAt(0);
char newFirst;
if ('first' >='a' && <= 'z'){ //if is a lowercase char
newFirst = first-32;//32 is the difference from lowercase to capital
}
else{//*maybe...
Forum: Java Aug 20th, 2009
Replies: 5
Solved: If/Array Error
Views: 224
Posted By PopeJareth
A second option would be to just have a item count variable which increments every time an object is added to an array. Then if the count is > 10 give appropriate responce.
Forum: Java Jul 30th, 2009
Replies: 8
Views: 499
Posted By PopeJareth
This doesn't address the lack of a method or correct the syntax of the switch statement.

Also there are no classes from java.util.* to be imported.
Forum: Java Jul 30th, 2009
Replies: 8
Views: 499
Posted By PopeJareth
This should work for you.

class t {
public static void main (String [] args){
//do stuff
char s = 'Y';
displayStuff(s);
}//end main

public static void displayStuff(char s){
Forum: Java Jul 13th, 2009
Replies: 6
Views: 552
Posted By PopeJareth
If you want to do a switch using a String then you have to use an enum

Here is a link for how enums work and how to use them.
http://www.xefer.com/2006/12/switchonstring
Forum: Java Jul 9th, 2009
Replies: 1
Views: 387
Posted By PopeJareth
your java file should be named the same as your class (in this case AverageNumbers.java should contain class AverageNumbers)

Also your main method should always be "public static void.main(String...
Forum: Java Jun 30th, 2009
Replies: 13
Views: 993
Posted By PopeJareth
At this point I am probably as confused as you. =(

Do you think it makes a difference if the applet is run on your pc or on a web server? The getCodeBase() method may give an error from the folder...
Forum: Java Jun 30th, 2009
Replies: 13
Views: 993
Posted By PopeJareth
The error is being thrown at line 26 of readFileApplet.java by the method getCodeBase().
I don't know for sure why. I haven't used URL or getCodeBase() before. Sun's documentation states that it get...
Forum: Java Jun 30th, 2009
Replies: 13
Views: 993
Posted By PopeJareth
You are probably getting this error because you are trying to do an action on an object that is 'null'. I would add an if statement saying

if (myObjects == null){
System.out.println("this was...
Forum: Java Jun 26th, 2009
Replies: 4
Views: 237
Posted By PopeJareth
What would you like an example of? Just let me know and can explain anything you need to know (hopefuly). =)

When I compile/run the program the method returns 84 as the value of area. Are you...
Forum: Java Jun 26th, 2009
Replies: 4
Views: 237
Posted By PopeJareth
I would try


import java.lang.Math;

public class CalcDrive {

public static void main(String[] arguments) {

CalcTest one = new CalcTest();
Forum: Java Jun 23rd, 2009
Replies: 4
Views: 292
Posted By PopeJareth
Please share =)
Forum: Java Jun 23rd, 2009
Replies: 2
Views: 916
Posted By PopeJareth
I have used this to write files...

DataOutputStream output=
new DataOutputStream ( new FileOutputStream(txtFile + ".txt"));

output.writeUTF(text);
Showing results 1 to 15 of 15

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC