Java Definition and 572 Threads

  1. J

    Schools Would Sun Java Certification significantly help my grad school prospects?

    I'm a physics student in the penultimate year of my degree. I'm quite good at programming and was thinking this summer I'd put in 3 months of effort and get Sun Java Certification. Would this be worth the effort? Would it be something which would be very attractive to a prospective grad...
  2. E

    Java Calculating Gravity in Java with 2 Bodies

    I'm pulling my hair out with this problem. I have two bodies and I'm trying to calculate gravity between them. This is for a game, and there are actually three bodies currently, each frame, I check the distance each one moves due to gravity and store it in a cache (to simulate gravity acting on...
  3. F

    Comp Sci Java Applet Help: Coding a Dots and Boxes Game Variant

    Homework Statement To code a dots and boxes game variant. Basically I need to code the same game except instead of drawing lines you choose two dots to form a line. I would need MouseListener for clicking and entering/exiting dots, a graphics update for changing colors of the dots and...
  4. K

    Comp Sci Which Language Handles Thread Operations Better for File Manipulation?

    Java or C++ - Threads HELP! I need help with this program. I got five others to do and I won't have time to do it and it's apart of my final exam for next Tuesday, can somebody write this program: Create 5 threads which share a file and let "even" threads write to a file, and let "odd" delete...
  5. K

    C/C++ Creating Threads in Java or C++: Balancing Writing and Deleting in Shared Files

    Java or C++ - Threads HELP! I need help with this program. I got five others to do and I won't have time to do it and it's apart of my final exam for next Tuesday, so here is my question I need: Create 5 threads which share a file and let "even" threads write to a file, and let "odd" delete...
  6. T

    Java Binary Tree java help please, with getRight and getLeft subtree.

    I can't figure out how to get these 2 methods to work. In my assignment description it says public BinTree getLTree() Get a reference to the left subtree. If this is not possible to do then throw an IllegalArgumentException. NOTE This routine returns a BinTree, not a Tnode. You...
  7. M

    Java Using Scanner in Java to await user hitting return key

    Hi all, I've been trying to figure out how I can use the Scanner class in Java to pause my program and wait for the user to hit the return key. What I have now looks like this: Scanner kbd = new Scanner(System.in); kbd.next(); ... The thing is, the rest of my program won't run unless there...
  8. K

    Java What Does java.lang.NumberFormatException: For input string: 'z' Mean in Java?

    i need to know what the error messege below means and how to fix it. Exception in thread "main" java.lang.NumberFormatException: For input string: "z" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:447) at...
  9. P

    Java How Can I Update My Java Language Filter?

    I have run into a problem... The language filter we have been using is out of date and it periodically does not work. I was hoping I could get some help on making a new one. The old one: import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; import java.net.SocketAddress...
  10. T

    Why Can't I Use Time Dilation to Calculate Relative Time for the Ball?

    I am new to this topic. Please correct me if there is any mistakes. http://i359.photobucket.com/albums/oo31/tanzl/JavaPrinting-4.jpg
  11. G

    Java Can You Help Me Debug My Java LinkedList Stack Implementation?

    Hi, i need to use a list class (provided and complete) and then use a Linkedlist class (need to add the methods) to get a stack going. I am having trouble with my remove from head method although I ain't too sure if my addHead method is right... I'd appreciate it if someone could look over my...
  12. T

    Java Java Keyboard Reader: V1.3 to Newest Version

    I have recently started to try to teach myself java and i can't get the keybord reader to work. I'm a book thet's for java V1.3 but I'm using the newest version is that the problem? unless the book was wong then my program syntax should be fine. could anyone tell me what the syntax for the...
  13. N

    Java Java 2 The Complete Reference - Herbert Schildt

    Has anyone here used this book? If you have, how would you rate it. To my surprise many programmers seem to despise Schildt's books. One is usually directed to this page to make the point. I was surprised because I found his beginner's guide on C++ quite easy to read and understand. (And...
  14. S

    Java Why Won't My Java Blackjack Game Compile?

    Making a blackjack game with Java, but it won't compile :cry:. Can't figure out why. Code import java.util.*; class Blackjack { public static void main(String[] args) { Scanner in = new Scanner(System.in); Deck myDeck = new Deck(); Player me = new Player(1000)...
  15. J

    Java Is it possible to decompile .exe files to Java using Jbuilder2007?

    I have Jbuilder2007 and I am wondering if there is a way i can decompile .exe files so i can read the code in java.
  16. A

    Java Improve Your JAVA Sudoku Game with Helpful Tips - Urgent Project Assistance

    Hi guys, I'm being asked to do a mini-project...Basically, i get a code in JAVA and "edit". Editting can be improving the interface, adding exception handling or adding features and so...I chose Sudodu as my topic..after much searching I found this code but I'm out of ideas, what can be improved...
  17. L

    Java Java: Check LinkedList<T> Classes

    Could someone check the following 3 classes for me please? public class LinkedList<T> { public Node<T> first; public Node<T> last; protected class Node<T> { public Node<T> next; public Node<T> last; } public class Iterator<T> { protected...
  18. L

    Comp Sci Creating a DoublyLinkedList Iterator in Java: Tips and Tricks

    Hi I'm struggling to create a DoublyLinkedList<T> class in Java. Well,it's actually the iterator that's freaking me out.. Most tutorials and documents I've read use three classes for this:Node<T>,DoublyLinkedList<T> and LinkedListIterator<T>. I can see the point in creating Node and...
  19. G

    Java Fix Java Compile Error: "The system cannot find the path specified.

    My problem is the first one listed here http://java.sun.com/docs/books/tutorial/getStarted/problems/index.html But when I type C:\jdk6\bin\javac HelloWorldApp.java I get the message "The system cannot find the path specified." Both the compiler and HelloWorldApp.java file are in C:/ folder...
  20. C

    Comp Sci Java calculations w/ conditional statements

    I'm supposed to calculate the cost of renting a Ford, Cadillac or Toyota, and use conditional statements to calculate the different costs of each vehicle. users are supposed to enter “F” for Ford, “T” for Toyota, or “C” for Cadillac users enter “F” for Ford, “T” for Toyota, or “C” for Cadillac...
  21. C

    Comp Sci Need Help Solving Java "Method Must Return a Result of Type Int" Error

    This is really making me mad. I keep getting a "this method must return a result of type int" error message, but obviously I have a return statement trying to return an int. This is a program that is supposed to perform a sequential search for a string index. public static int...
  22. A

    Java Solve Simple Java Annagrams Problem

    [SOLVED] Simple Java Problem Hello, In my computer science class, we were assigned to design an annagrams class, which would create a HashMap of String => HashSet, a sorted sequence of letters mapped to all annagrams of those letters found in the dictionary. This was done. Sample entries...
  23. C

    Comp Sci Solve Java JLabel Problem: Display Output on mainPanel

    i am trying to display the output in a jlabel. I have created individual jlabels for the package ID, weight, and shipping cost and tried to display them with the mainPanel: import javax.swing.*; import java.awt.event.*; public class shippingCharge extends JFrame implements ActionListener {...
  24. E

    Java Help with Java Classes for Blog App Project

    Hello! I have a project in which I must simulate a blog application,with users' post mangament. These are the requirements: A blog has a title and a collection of posts.The posts have the following information: -author -data -title -text Each post has a code that is generated...
  25. C

    Comp Sci Java Project Calculator for Shipping Costs

    i'm supposed to create a GUI project that will display a package ID and calculate its shipping cost. the shipping cost is calculated per ounce, and i must convert the pounds to ounces for the shipping cost. everything seems to be working fine except for the calculation. the shipping cost is...
  26. W

    Comp Sci How can I fix my Java program to give accurate change?

    I had to write a java program that will give you the change for whatever random number that program picks. I keep having a problem with the pennies. If have to have more than one penny then program will repeat the output until it gets the pennines right. PLEASE HELP! I am not really good at...
  27. N

    C/C++ Download Java & C++ eBooks for Home Learning

    hii i need a link that i can downlaod from it books (dammes series) about java & c++ because i am learn it in home
  28. Math Jeans

    Java Solving Java File Not Found Error - "Sgrep.java

    Hello. I am having some trouble getting a java program to work. I am supposed to make a program that takes a word and a file name, and finds all lines in that file that contain that word. The word that I chose was "try", and the file was "Sgrep.java" Here is the main method: class main...
  29. L

    Comp Sci How do I construct nodes with values in a generic Java LinkedList?

    [SOLVED] Java LinkedListNode class Hi.. I'm trying to understand a generic linked list...in Java. I understand that I should have a LinkedList class containing a Node class. The Node class should have an info variable and a link variable.These variables should be accesessed through the...
  30. C

    Comp Sci How to Structure a UML Diagram for a Basic Java Program?

    So I have to create a UML diagram for my program: import java.util.*; import java.text.*; public class NameDate { public static void main(String[] args) { // Input the first, middle, and last name // Display the name and the date. String firstNameString, middleNameString...
  31. C

    Comp Sci How do I fix a java.lang.NoClassDefFoundError in my Java program?

    Supposed to make a program that displays an entered name and date, etc, but it won't run. import java.util.*; import java.text.*; import javax.swing.*; public class ch2NameAndDate { public static void main(String[] args) { // Input the first, middle, and last name //...
  32. T

    Java How to create an executable java application?

    Hi, I've recently written a small program to calculate multiplicative group tables for Z mod n. I wrote it in java, as that's the only programming language I currently know. import java.util.*; public class ZnX { public static int gcd(int a, int b) {...
  33. U

    Java Can java applet be as big as the browser window

    Here's a java applet that shows the electric field of a moving charge (it's actually incorrect, it only gives a rough idea how motion and acceleration affect electric field). http://www.cco.caltech.edu/~phys1/java/phys1/MovingCharge/MovingCharge.html Can a java applet like this be the same...
  34. S

    Java Simple Java Email Harvester Program

    Hey guys, I am learning Java and am attempting a project from a book, but I have run into a problem. I don't have an issue when it comes to harvesting an address that has whitespace on both sides. My issues come when a) the input doesn't contain whitespace on either side of an address and b) the...
  35. U

    Java AJAX vs JAVA: A Comparison of Web Development Languages

    Which one is better? It turns out that AJAX suffers from the fact that 90% of development time is spent trying to work around intricacies of specific platforms, which is why google came up with a library that converts JAVA applets into AJAX code. But why not stick with JAVA anyway? Can't JAVA...
  36. U

    Java Suggest me some good books for java

    hi frnd ... suggest me some good books for java ... im a beginner .... i read "java complete reference " .... i want some new advanced books
  37. O

    Java How to Count Rows and Columns in a Two-Dimensional Array in Java?

    I just have a question about my "solution" to a problem. The question says to write a value returning method that returns the number of rows in a two-dimensional array of doubles. It should be simple enough and so I did it like this: public int countRows() { int x; x = 0; for (int...
  38. V

    Java Question about this java program

    OK here is my source code for a small Java program I wrote to approximate the number e: import java.util.Scanner; public class E { public static void main (String[] args) { double e = 0.00, current_e = 0.00; int x, number_of_digits; Scanner scan = new Scanner (System.in)...
  39. T

    Java Fixing Syntax Issues with Java File Inputs

    So I made a program that finds files and searches in them for key terms using the scanner class in java.util.*; I've written it something like this: Scanner filereader = new Scanner(System.in); String filename = filereader.nextLine(); Scanner searcher = new Scanner(new File(filename)); The...
  40. B

    Comp Sci Find the Second Largest Integer in a Java Array | Simple Function Example

    Q1. Write a function that accepts an array of integers and returns the second largest integer in the array. Return -1 if there is no second largest. The signature of the function is public class ID { public static void main(String[] args){ } int f(int[ ] a) { } } Examples...
  41. R

    Java Help! Can't Get Java After Computer Reboot

    I recently had to get my computer rebooted using a fake operating system of XP due to a virus. But i can't get Java anymore! I can't validate my system as it requires that do proceed with the download. Is there anyway i can get it...?
  42. K

    Java Interested in Learning Java? Here's What You Need to Know to Get Started!

    Look am very interested by computer programming and now am learning The C++ language that's why i would like to ask anybody who can teach me java, just thank you
  43. S

    Java Java and other high level languages for computational science

    Hi, I'm interested in pursuing a career in computational science and numerical computing and so on. I'm looking for some fairly general advice on how to direct my studies. I started learning programming in java, which I very much prefer to program in these days, having had some exposure to...
  44. S

    Java How can I use Java to control external programs based on my network latency?

    Hi, i would like to make a program which can detect my latency, if it's low then it would open a program and if it's high it'd do nothing, i'd also like to loop it so it tries every half an hour or so. Would this be possible? If so any advice on how to start I'm a bit rusty and have only tried...
  45. N

    Java Comparing Python and Java: Performance & Standard Libs

    Any one have any opinions on the differences between these two language (and their closeness to C)... chroot posted about python being almost as complete as java interms of standard libs. I attended a presentation which seemed to verify that claim though you have to download some of the added...
  46. P

    Java How can I add an integer to a sorted array using binary search in Java?

    Hello, I need to write a method that adds an interger to a sorted array of integers. I'm using the following code to search for an interger in the array private static int binarySearch(int[] list, int key, int low, int high) { while (low <=...
  47. A

    Java Creating a Java Voice Chat Room with Admin Functions

    What I want to do is make a Voice chat room with administrative functions embedded in a website. i think the best way is to use Java, but I don't know anything about java. i can't start from scratch and learn the language, because this is really important and I have less time. i was hoping if...
  48. P

    Java Quick Help for Java Homework: Hare and Tortoise Race in 70 Squares

    Hi! can you help for java homework? i wrote but the program give error . homework: in 70 squares show to the hare and the tortoise race i need to do this homework quickly! thank you to help in advance!
  49. R

    Java Java: writing pictures to a file

    hello, I need the code to write pictures to a file so I can read them sequentially.
  50. J

    Java Java question: how can I stop my polygon from translating?

    I'm trying to create a computer game (a platformer); currently I'm just trying to display a Polygon on the screen. I have this class Charac, which contains a Polygon which defines its shape. If you display the bare Polygon, it'll put the shape at 0,0 on the screen. In order to move the...
Back
Top