No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
13 Posted Topics
Re: What are you having trouble with exactly? I'm not going to spoonfeed you the entire Class but all you really need to get started is [code=java] public class MyPoint { private int x, y; } [/code] | |
Re: Use something like [code="syntax"] if(exampeString.contains("-")) { // etc } [/code] | |
Re: [code] String fishX[] = {" Hakula"," Ngatala"," Atu"," Palukula"," Valu"," Takuo"," Mahimahi"};//fish menu double fishY[] = { 4.50, 6.75, 4.45, 4.80, 5.10, 4.20, 6.90,};//price of the fish int leng = fishY.length; double discount1 = 1.80; //discount 10% double discount2 = 7.20; // discount 20% double price = 0; double total … | |
Is there a way to add data into a RandomAccessFile using seek(long) without writing over the data at that position and beyond? For example: [code] public static void main(String[] args) throws Exception { RandomAccessFile raf = new RandomAccessFile("test.txt", "rw"); raf.writeBytes("Hello, World!"); seek(2); raf.writeBytes("Goodbye, World!"); raf.close(); } [/code] Using that the … | |
Re: [code=java] public VarnaServer() throws Exception { System.out.println("Starting Server..."); System.out.println("Creating Server Socket"); server = new ServerSocket(3000, 50, InetAddress.getLocalHost()); System.out.println("Server Socket Created at: " + server.getInetAddress().getLocalHost()); this.start(); } [/code] I know it is marked as solved, however you can also use InetAddress.getLocalHost() to return the address. | |
Re: Following on from what jon.kiparsky said, protected also allows sub-classes direct access to the variable/method, whereas private does not and public would allow complete access to every class. Protected is in someways between public and private. | |
Re: [code=c] int main() { float principle, rate, n ,interest; int count = 0; while(++count <= 3) { printf("\nPlease enter the principle, rate and number: "); scanf("%f %f %f", &principle, &rate, &n); interest = (principle * rate * n) / 100; printf("%f", interest); } } [/code] Shouldn't all the variable except … | |
Hello, I just need some help in ByteBuffer's put(index, byte) method. Basically I have a byte array which stores data and is put into a ByteBuffer. The problem I'm facing is I want to put extra data in the ByteBuffer in index 2 (The positioning is very important) How would … | |
Hello from Australia =] My question is rather simple but confusing. When i create abstract classes i alway create them so it can be extended at a later date by a normal class, The ByteBuffer in the nio package is unable to be extended due to its private constructor. In … | |
Re: [url]http://mindprod.com/jgloss/interfacevsabstract.html[/url] I think that is what you are after | |
Re: Instead of using finally, After the last out.print add out.close(); under it. | |
Hello. Currently i am creating a small application that works around packets. The packets are sent every 600ms. Now my quesition is this: Currently i have this (An example) [code="syntax"] public class Example { private int exampleInt = 0; public void setExample(int i) { exampleInt = i; } public void … | |
Re: Just an addition to mukulbhave's post Thread.sleep is in milliseconds to convert seconds to milliseconds seconds x 1000 (Just incase you didn't know) |