Java Definition and 572 Threads
-
C
Java Why Does My Java Graph Show Incorrect E Field Values?
I am using JAVA to generate a graph of the E field close to a conducting plane. The result which I want to graph is $$E_z (x)= \frac{Q}{2\pi \epsilon_o} \left(\frac{d}{(x^2+d^2)^{3/2}} - \frac{h}{(x^2+h^2)^{3/2}}\right).$$ The code is below: import java.io.Console; import java.io.*; import...- CAF123
- Thread
- Java Strange
- Replies: 4
- Forum: Programming and Computer Science
-
A
Java How to Adapt the Nelder Mead Algorithm for a Custom Function in Java?
Hi This is a question somewhere between maths and numerical methods... I am using the algorithm for Nelder Mead found here: http://www.ssl.berkeley.edu/~mlampton/neldermead.java in java. It works nicely with the two example functions - rosen and parab. I am trying to adjust it to my function...- a.mlw.walker
- Thread
- Algorithm Java
- Replies: 6
- Forum: Programming and Computer Science
-
A
Java How Can a Beginner Tackle Learning Java and Android Programming?
I'm an undergraduate, and I have a scholarship to help do research with one of my professors. He's assigned me to learn Java and how to program Android apps. I have absolutely no programming experience. It seems like they expect me to get it down in a couple of weeks, but there is just so...- axmls
- Thread
- Android Java Programming
- Replies: 10
- Forum: Programming and Computer Science
-
T
Java Suitability of Java for computational physics, as compared with C or F
I have recently begun physics graduate school. My own programming background is in Java, but I haven't done much computational physics of a caliber that required me to implement things *well*. My research advisor states that most of the numerical simulation that takes place in our field...- thecommexokid
- Thread
- Computational Computational physics Java Physics
- Replies: 21
- Forum: Programming and Computer Science
-
N
Java Best way to learn Java in 3 months?
I'm joining my school's FIRST Robotics club, and our supervisor has said that we will be using Java to program our robot this year. I have self taught myself Python and enjoyed it, but does any pone have any advice/tips/links for helping learn Java? I know it's a whole different animal...- NextElement
- Thread
- Java
- Replies: 5
- Forum: Programming and Computer Science
-
A
Java What is the problem with excessive indentations in Java if-else statements?
Hello everyone. I am a little confused as to how I should organize if else statements in java. Here is an example from my Leap Year program: if (x<1600) { System.out.println(setError); } else if (x>2013) { System.out.println(setError); } else { if...- ArthurRead
- Thread
- Java
- Replies: 15
- Forum: Programming and Computer Science
-
J
Java Unable to run Java applet on my machine
Hi, I'm running Internet Explorer 10 and when I go into manage add on, I see Java is enabled. However, when I try to run the applet in this link http://www.certicom.com/index.php/33-experiment-an-elliptic-curve-model-over-fp about elliptic curve cryptography, I'm unable to run it. I...- jackmell
- Thread
- Java Machine
- Replies: 8
- Forum: Programming and Computer Science
-
P
Java How to Get the Rectangular Form of a Complex Number in Java?
Hi, I'm doing a mini-project in java that involves some nasty calculations with complex numbers- particularly with complex numbers in exponents. Thus far, I've had success using this class: Complex.java . The problem that I'm encountering involves taking the natural logarithm of a complex number...- pierce15
- Thread
- Complex Complex numbers Java Numbers
- Replies: 2
- Forum: Programming and Computer Science
-
C
Comp Sci How can I fix errors in my Java Complex Number Class Homework?
Homework Statement Create a class which contains the following: a)instance variables for the complex number. For x+yi, x and y are the variables. b)constructor to initialize these variables. c)methods to return the real and imaginary parts of the complex number d)method to compute the...- CAF123
- Thread
- Class Complex Complex number Java
- Replies: 47
- Forum: Engineering and Comp Sci Homework Help
-
Y
Java Solving Java Installation/Uninstallation Problems
I have problem with installing and uninstalling Java. Some of my work cannot be completed without a working Java. I tried to uninstall Java(TM) 6 Update 37 , it gave me an error message: [SIZE="4"]Error 1723. There is a problem with this Windows Installer package. A DLL required for this...- yungman
- Thread
- Java
- Replies: 4
- Forum: Programming and Computer Science
-
C
Comp Sci Simple program to sketch graph in JAVA
Homework Statement See code below: The Attempt at a Solution I am simply trying to get the code to work: When I try to compile, the terminal says that apparently the package ptolemy.plot.* package does not exist and so does not recognise statements like PlotFrame etc.. Why is this...- CAF123
- Thread
- Graph Java Program Sketch
- Replies: 20
- Forum: Engineering and Comp Sci Homework Help
-
B
Java Need some help with an equation(s) for a basic Java program
I am writing a basic program using Java. The function is to break up any number the user inputs into smaller values, the catch is that these smaller values have a maximum usage and the overall result has to use the combination with the highest amount of values. I am figuring out the code just...- Billogi
- Thread
- Java Program
- Replies: 9
- Forum: Programming and Computer Science
-
Comp Sci Java Array Problem: Wizard/Elf Character with Random Health and Gold Points
Ok, I have a java app that allows you to choose a class (wizard/elf) and is supposed to give a random amount of health (an array with 10 values) and 25 points of health. When I run the program it gives me the memory location from the array and not the value. I know I am missing something simple...- iamjon.smith
- Thread
- Array Java
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
Java How to make a search engine by Java ?
want some sites to teach me how to develop a simple web-based search engine that demonstrates the main features of a search engine (web crawling, indexing and ranking) and the interaction between them. Using Java :confused:- Todee
- Thread
- Engine Java Search
- Replies: 2
- Forum: Programming and Computer Science
-
J
Java Java question: Need some sort of global variable.
Just wondering if the Java experts here could help me. As part of a project I'm making a function [FONT="Courier New"]rand9() that returns a pseudo-random number 0 through 9. The problem is that each time it's called I need a certain number to increment so that it can generate a new (not...- Jamin2112
- Thread
- Global Java Sort Variable
- Replies: 6
- Forum: Programming and Computer Science
-
A
Comp Sci Java Tic-Tac-Toe Project: Create a Game with Unique Position Restrictions
Homework Statement So, we have a project to make a tic-tac-toe game and for bonus points we can make sure the player(s) can not enter the same position more than once. I can't think of a way to do this. I'm sure I need to use a 'for loop' or a 'while loop'. I am using eclipse to write the...- Albeaver89
- Thread
- Java Project
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
S
Java Which Resource is Best for Learning Java: Online Tutorials or Printed Books?
For learning C and for references, " The C Programming Language" by Dennis Ritchie and Brian Kernighan is an authentic. Which book should I refer to if I need to learn Java the same way?- sudu.ghonge
- Thread
- Java
- Replies: 1
- Forum: Programming and Computer Science
-
Looking for a Book to Learn Java and OOP?
I'm currently trying to learn java and I've managed to pick up most of the basics from tutorials and stuff on the internet (loops, conditionals, defining functions etc.). However none of them provide a good explanation of OOP and how to use it in java, except for a very trivial example like...- trollcast
- Thread
- Book Java Oop
- Replies: 3
- Forum: Science and Math Textbooks
-
J
Java This error (Java) is confusing me
It's saying I don't have an 'if' statement for my 'else if' statement, but I [SIZE="4"]do. You can see clearly from this picture that I do.- Jamin2112
- Thread
- Confusing Error Java
- Replies: 19
- Forum: Programming and Computer Science
-
J
Java [Java] Can't figure out this Illegal start of expression error
[Java] Can't figure out this "Illegal start of expression" error From my Java code: [FONT="Courier New"]while (info.substring(j, j)) != " ") { name += info.substring(j, j); j++; } gives an "illegal start of expression" error- Jamin2112
- Thread
- Error Expression Figure Java
- Replies: 6
- Forum: Programming and Computer Science
-
O
Comp Sci Java Help: Decimal Format Class
Homework Statement Problem: Tele-Annoy, a telemarketing company has asked you to write a program that when given the area code to dial, generates the next three potential telephone numbers, and then outputs them to the screen for one of their sales representatives to call. Use the area code...- Ocasta
- Thread
- Class Format Java
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
S
Java [Java] what's wrong with my bubble sort algorithms?
I have 2 possibilities, non of them worked: PD: I am sure that all the methods inside this method(s) are correct and I am sure that the program's GUI is refreshing effectively. public void metodo1() { for (int i=0; i<(perros.size()); i++){ for (int j=perros.size()-1...- stonecoldgen
- Thread
- Algorithms Bubble Java Sort
- Replies: 2
- Forum: Programming and Computer Science
-
M
Java [JAVA] Question about data flow betwean methods
Hi, Wanted to ask you guys how does Java know what specific parameter to take into a method if the method name has to be only - let's call it - "internaly consistent" (meaning the parameter in the head and the body have to be the same). E.g. if I pass a value to the method: private int...- mindauggas
- Thread
- Data Flow Java
- Replies: 4
- Forum: Programming and Computer Science
-
M
Java [JAVA] I seem to always need to enter the class path to run the program
Hi, I wanted to try to use cmd to compile and run a program in java. I have sucessfully compiled it. The compiler is working properly (C:\new> javac output the compilers functions), but I'm always getting the same error: "Error: Could not find or load main class hello". When I specify the...- mindauggas
- Thread
- Class Java Path Program
- Replies: 4
- Forum: Programming and Computer Science
-
O
Comp Sci Java GUI program determining retail price, does not finish running
Homework Statement Just trying to finish up this assignment, no errors. I run the program, enter a value and a percentage, then click calculate. Program just runs, never displays results. Check my code below, let me know if something is wrong. Driver: package ch7pc1; import javax.swing.*...- opaquin
- Thread
- Gui Java Program Running
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Java Java noob - help setting up eclipse
Hello and thank you for putting up with this noob question. The directions on the website or anything I have found on the internet are not very descriptive. I have downloaded Eclipse and Java JDK version 7 and successfully installed both of the applications on my computer, but I must have...- Hercuflea
- Thread
- Eclipse Java Noob
- Replies: 8
- Forum: Programming and Computer Science
-
F
Java Trying to come up with simple algorithm of significant time complexity in Java
Hi PF, I'm working on a program that requires measuring how long it takes a given computer to process a certain task, but am having trouble coming up with algorithms that won't take most computers a trivial amount of time to perform. The only one I've got so far is recursively computing...- frankfjf
- Thread
- Algorithm Complexity Java Time
- Replies: 1
- Forum: Programming and Computer Science
-
P
Comp Sci Java Non-Recursive du command popping java.lang.InterruptedException
Homework Statement You are to write a robust program (i.e., a public static void main()) that accepts a file pathname (e.g. 'c:\foo\bar' or '/home/jblow/' under UNIX) as input and then calculates and prints the size of that filesystem object: java FileSize c:\foo\bar 123625 bytes The purpose...- peterpiper
- Thread
- Java
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
C
Java Very simple java program not working
I am using the netbeans IDE All I am trying to do is print out to the screen, but I keep getting this error. Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: system.out.println at mysqlconn.mainhgf4.main(mainhgf4.java:19) Here is my...- camel-man
- Thread
- Java Program
- Replies: 3
- Forum: Programming and Computer Science
-
T
Comp Sci [Java] Generating a Time Array Problem
Homework Statement I'm given a maximum time, a time step (or interval) and I'm supposed to form an array from 0 to the maximum time going up by timestep each time. double tMax; //maximum time double tStep; //time interval to go up by Homework Equations Our teacher told us to use the...- testme
- Thread
- Array Java Time
- Replies: 11
- Forum: Engineering and Comp Sci Homework Help
-
U
Java [JAVA] please tell me this for loop
Hey guys, I have an ArrayList<String> al = ArrayList<String>(); and I have a textbox, the textbox allows a user to enter a word and that word will be added into the ArrayList. When I print the list out it looks like this [Cat, Dog, Mouse] can you please write out the for loop that I need...- uperkurk
- Thread
- Java Loop
- Replies: 4
- Forum: Programming and Computer Science
-
S
Java [Java] what the hell am I doing wrong with this graphical interfaze?
I have a package with all the classes needed to perform the functional recquirements (calculations, etc.). It's working perfectly. The "main" class is "FinalesCopaMundo" I have another package with all the classes needed to perform the GUI. The "main" class is "InterfazFinalesCopaMundo". I...- stonecoldgen
- Thread
- Java
- Replies: 2
- Forum: Programming and Computer Science
-
U
Java Java GridLayout for Applet Window: Add, Display, Search, and Remove Words
Can anyone tell me how to get the Textbox to the bottom of the applet window? public void init(){ setLayout(new GridLayout(6,0,5,5)); al = new ArrayList(); addNewWords = new JButton("Add Word"); displayAllWords = new JButton("Display Words")...- uperkurk
- Thread
- Java
- Replies: 1
- Forum: Programming and Computer Science
-
Java Debugging Java Quicksort Code: Tips and Tricks for Optimal Results
Hi all. I am currently working on quicksort and have written the following code and gives "almost" good results. I am not too fond of the data structure I have chosen but it is too late for me to change. Lesson learned. Can anyone help me debug this thing. I have been at it for a while. Anyway...- perplexabot
- Thread
- Code Java
- Replies: 5
- Forum: Programming and Computer Science
-
C
Comp Sci How Do You Design a Circle Class in Java with Overlapping Circle Detection?
Homework Statement Homework Statement I need to write a class that represents a circle object and includes the following; -Private Class variables that store the radius and centre coordinates of the object. -Constructors to create circle objects with nothing supplied, with just a radius value...- CAF123
- Thread
- Java
- Replies: 23
- Forum: Engineering and Comp Sci Homework Help
-
T
Java Returning a Correctly Sized Array for Dive Moves
If I have a program where I need to return an array, is it possible that I only return the array with the length of what was added to it? What I mean is I have an array that gets filled up with letters but it doesn't always get completely filled up. Is there a way I can only return the...- testme
- Thread
- Array Java
- Replies: 6
- Forum: Programming and Computer Science
-
C
Comp Sci Java Program for Damped Harmonic Oscillator Solutions | Ptplot Package
Homework Statement I have to write a JAVA program that will compute and display (via the ptplot package) the solutions for the damped harmonic oscillator (x against t) in some given range for t. The solutions vary depending on how gamma and omega are related. The instructions given were: 1)...- CAF123
- Thread
- Java Program Shm
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
F
Java Timing a Task in Java – Find Out How!
Hi PF, I am trying to write a program that utilizes a for loop that skips the current iteration (via continue) if it takes too long (for instance, longer than 20 seconds, else it finishes the current iteration as per normal), but am not sure how to best do this. Does anyone know of a way...- frankfjf
- Thread
- Java
- Replies: 2
- Forum: Programming and Computer Science
-
R
Java [Java] Class and Driver Class help
Hello, I am trying to figure out what I did wrong and I couldn't figure it out. here is the error code: setMake(java.lang.String) in Automobile cannot be applied to (). Class file: import java.util.Scanner; public class Automobile { private int num; //number of automobiles to...- redskins21
- Thread
- Class Java
- Replies: 2
- Forum: Programming and Computer Science
-
C
Comp Sci Java ArrayList Help: Troubleshooting Unexpected Type Error
Homework Statement I'm working on a program that uses an ArrayList to hold a collection of UserID objects (which contains the first and last names, plus username and password). When I add a new UserID to the list, I want to check to make sure that it is not already there. This is the error...- csgirl504
- Thread
- Java
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
S
Java Problem defining a constant in java
I have: public final static int NUMERO_ESCENARIOS=4; escenarios = new escenario[NUMERO_ESCENARIOS]; having an error in the first line that says: Syntax error on token ";", , expected but when I have: public final static int NUMERO_ESCENARIOS=4 //semi colon deleted escenarios =...- stonecoldgen
- Thread
- Constant Java
- Replies: 4
- Forum: Programming and Computer Science
-
H
Java Java: PNGException: Premature End of JPEG File
I'm getting this error sun.awt.image.PNGImageDecoder$PNGException: crc corruption at sun.awt.image.PNGImageDecoder.getChunk(Unknown Source) at sun.awt.image.PNGImageDecoder.getData(Unknown Source) at sun.awt.image.PNGFilterInputStream.read(Unknown Source) at...- haxor489
- Thread
- Java
- Replies: 2
- Forum: Programming and Computer Science
-
L
Java Compiling multiple paged java project
i have been learnin java for about two weeks. i have gone through simple programin and some other programs includin GUI through swing. till that i was working with single form programs that can be compiled by using "javac" and executed by "java" syntax.now to try better i downloaded a java...- learningjava
- Thread
- Java Multiple Project
- Replies: 2
- Forum: Programming and Computer Science
-
Comp Sci Java - calculate nth Fibonacci number
Homework Statement Hello everyone, I am trying to write a java program that asks the user to input a number n, and the computer calculates the nth Fibonacci number. I am supposed to use a loop to calculate the problem. My question is, how do I set up the loop to calculate the nth...- Hercuflea
- Thread
- Java
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
Java What are the differences between Ruby and Java Script?
[url]0QZgx45aGCA#[/youtube]- Borek
- Thread
- Java Ruby
- Replies: 5
- Forum: Programming and Computer Science
-
M
Java Confused about Java and Glassfish
Hello, I just downloaded the Java Development Kit (J2EE) and during the install I was asked to configure something called Glassfish. I don't understand what Glassfish is for. Is it only for Web development? What does it do for me?- MLP
- Thread
- Confused Java
- Replies: 1
- Forum: Programming and Computer Science
-
M
Comp Sci Write a Java program to convert binary numbers to decimal numbers.
Use a loop to read (charAt()) each digit (0/1 char) in the input string, scanning from right to left; Use the loop to build the required powers of 2; Use a conditional statement to deal with 0 and 1 separately; Debug using simple input, e.g. 1, 10, 101, and print intermediate values in...- Mehwish-S
- Thread
- Binary Convert Java Numbers Program
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
S
Java [Java] error:can not find symbol. I don't know what the hell is happening
import java.util.Scanner; import static java.lang.System.out; import java.util.Random; public class wolf { public static void main (String[] args){ int hitpoints = 100; int damage = 40; //un numero cualquiera, solo para hacer una prueba Scanner keyboard = new Scanner(System.in)...- stonecoldgen
- Thread
- Java Symbol
- Replies: 4
- Forum: Programming and Computer Science
-
S
Java Can I assign probabilities to events in Java?
Hello. So I'm wondering if there is a way to assign a probability to a certain event in the code. Let's say that I want a certain arithmetic operation to have an 80% chance of happening (and make an if/else if statement based on that, or something similar...) Is there something in the...- stonecoldgen
- Thread
- Events Java Probability
- Replies: 1
- Forum: Programming and Computer Science
-
Y
Java Can someone help with my Java installation issue?
I have been trying to install Java and failed. After installation completed and close the installation window, an error message popped up saying: "Wrapper.CreateFile failed with error 5: access denied." The java don't work. I tried reinstalled a few times and still failed. Please help...- yungman
- Thread
- Java
- Replies: 9
- Forum: Programming and Computer Science