- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
19 Posted Topics
Re: The class that contians 'public static void main' must have static declared for all methods contained. so your code should look like this... [code=java] public class Pay {public static void main(String[] args) { //program }//end main method public static void myFunction(){ }//end myFunction } //endClass [/code] | |
Can Someone tell me why these files won't compile on unix but work fine (mostly) in windows? It looks like unix-land doesn't load the variables from the inherited class QueueArray into the proper scope. prog5.cpp is supposed to create 3 different types of Deque classes. each Deque inherits from ArrayQueue … | |
Re: I have used "\t" to tab over to a lined up position. That could be an option for you. | |
Is it possible to compile a single .cpp (not a project) in visual studio 2008? Also will using visual studio cause problems executing code on a unix system? I am making my first c++ "hello world" program and I am attempting to use visual studios. Am I going to have … | |
Re: [code=java] 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 some other error checking* newFirst = first; } [/code] Attached is a great ASCII table. Hope this helps | |
Re: 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. | |
I am trying to find a way to add a something similar to a blog on my site. What I would like is to be able to post updates, include pictures if desired, and have the content dynamically added to an existing page. I would like to see something where … | |
Re: I don't know if this is related but, once several Google bots were constantly ambushing my site and were the cause of it going down. Do you guys think that could be a possible cause. All we had to do was add a meta tag to stop the bots | |
Re: From what I was reading it doesn't seem that method overloading is possible in php. "However, PHP 5 provides a way to imitate overloading by catching calls to “inaccessible methods” with magic method __call." [URL="http://www.xml.lt/Blog/2008/12/02/Method+overloading+in+PHP+5"]http://www.xml.lt/Blog/2008/12/02/Method+overloading+in+PHP+5[/URL] On a side note. It is possible to use method overload in java. No reserved … | |
Re: This should work for you. [code=java] class t { public static void main (String [] args){ //do stuff char s = 'Y'; displayStuff(s); }//end main public static void displayStuff(char s){ switch (s){ case 'Y':System.out.println("Yes"); break; case 'N': System.out.println("No"); break; default: System.out.println("Default"); break; } } } [/code] | |
Re: [QUOTE=MidiMagic;926116]You really can't control what the page looks like until it finishes loading.[/QUOTE] You can use a javascript in the header to cache the images before the page starts to display. [code=javascript] <SCRIPT LANGUAGE="JavaScript"> <!-- hide from non JavaScript Browsers Image1= new Image(50,60) Image1.src = "thing.gif" Image2 = new Image(70,80) … | |
Re: 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. [URL="http://www.xefer.com/2006/12/switchonstring"]http://www.xefer.com/2006/12/switchonstring[/URL] | |
Re: 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 [] args) { " Without the "static" you will have compilation errors. This should get you running =) [code=java] /** * … | |
I am working on a page that has 3 columns of text. I am trying to center the text in each column while maintaining the left justification for the text. When I try to use [icode] margin-left:auto; margin-right:auto;[/icode] the spacing for the columns is destroyed. I have also tried putting … ![]() | |
Re: 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 [code=java] if (myObjects == null){ System.out.println("this was null"); [/code] That will help you find what may be causing the problem. When I try … | |
Re: I would try [code=java] import java.lang.Math; public class CalcDrive { public static void main(String[] arguments) { CalcTest one = new CalcTest(); int b = 7; int c = 12; int a = one.getArea(b, c); System.out.println("the area is: " + a);//corrected variable name } } class CalcTest{ public CalcTest(){//you need a … | |
Re: I have used this to write files... [code]DataOutputStream output= new DataOutputStream ( new FileOutputStream(txtFile + ".txt")); output.writeUTF(text);[/code] |
The End.