Java Definition and 572 Threads
-
E
Comp Sci Implementing a PriorityQueue w/ a Doubly-Linked List (Java)
Homework Statement Basically, as the thread title says, I've got to implement a Priority Queue with a Doubly-Linked List in Java. This is an excerpt from the instructions for the assignment: I've assumed that priority is given to larger integers (since it wasn't specified in the...- Enharmonics
- Thread
- Java List
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
J
C/C++ Java vs wxWidgets or GTK+ with c++ for a PC ground station
I've got experience with win32API but its' a pain in the ass. What else is good for cross platform low level programming of apps, want it to work for PC, linux, be able to handle serial data streams, convert data and do C++ tier things. So far been using processing but that's not powerful...- Jarfi
- Thread
- Application C++ Desktop Ground Java pc Robotics
- Replies: 4
- Forum: Programming and Computer Science
-
Java How to Fix Flickering JFrame in Java Minesweeper?
Hello, I am currently working on a version of Minesweeper that uses Java. Currently the code seems to work relatively well and the game runs properly, however there is an issue. I currently have the set to update the board on every mouse click and release, as these are currently the only actions...- Kaura
- Thread
- java
- Replies: 1
- Forum: Programming and Computer Science
-
D
Programs Programming courses useful for physics majors?
I'm a physics undergrad and was wondering which programming classes are most useful/beneficial; python, linux, c++, java, etc...- danielle
- Thread
- Courses Java Linux Physics Programming Programming c++
- Replies: 5
- Forum: STEM Academic Advising
-
S
Java Any beginning computer programming course (such as for JAVA.
Not necessarily for JAVA, but in any beginning computer programming course at a college or university: What will the school, or department, or the teacher require of the students? Need the student use their own personal computer for this? Can student do the work using JAVA without having an IDE...- symbolipoint
- Thread
- Beginning Computer Computer programming Course Java Programming
- Replies: 2
- Forum: Programming and Computer Science
-
Java Runge-Kutta method for Simple pendulum in java
Hi, I'm trying to study Runge-Kutta method and apply on a simple pendulum. Using a timestep dt=0.1 (h=0.1) the pendulum increses energy of 1% every period... while in this site: https://www.myphysicslab.com/pendulum/pendulum/pendulum-en.html decreses energy about 0.01% What am I doing wrong...- sefiroths
- Thread
- Java Method Pendulum Runge-kutta Simple pendulum
- Replies: 1
- Forum: Programming and Computer Science
-
E
Returning an array of generic type
This is a homework problem, so I have to follow some stipulations, namely: The problem is, I have no idea how to get a method to return a generic-type array. Because of type erasure, I can't create an instance T[] of a generic array, empty or otherwise. The only way I was able to do it was...- Enharmonics
- Thread
- Array Arrays Java Type
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Java Asynchronous web programming using Java
I want to learn web programming with Java. I'm using eclipse neon with tomcat 8.5.13. My question is do these tools support asynchronous programming and server push technologies or should I use other tools? Thanks- ShayanJ
- Thread
- Asynchronous Java Programming Web
- Replies: 6
- Forum: Programming and Computer Science
-
N
C/C++ How Can I Convert Quicksort from Java to C++?
I have never done Java but my professor says it is similar to c++. I am trying to convert quicksort in java and covert it to c++. I don't know if this is correct or not. Here is the code my professor gave us. .....Java...... public static void quicksort(char[], int left, int right) { int...- needOfHelpCMath
- Thread
- C++ Java
- Replies: 3
- Forum: Programming and Computer Science
-
N
Java Recursive Tracing Java: Learn How to Trace a Method
It would be much appreciated if you could show me how to do recursive tracing for this method.- Neon32
- Thread
- Java tracing
- Replies: 12
- Forum: Programming and Computer Science
-
L
Java Shopping cart object problems using methods, and arrays no arrayLists. java
Hello, I cannot seem to get the calculations correct for my shopping cart to print out the tickets and total how many tickets and how much they are. The first set of code is for the shopping cart the comment sections are for what is suppose to be happening in each section. I have the menu...- lypena35
- Thread
- Arrays Cart Java
- Replies: 2
- Forum: Programming and Computer Science
-
Java Java Sudoku Solving Program: Debugging Help Needed
I am attempting to create a Sudoku Solving Program in Java This is what I have to far https://pastebin.com/raw/tgnAGKb2 I have spent close to an hour trying to debug it but to no avail Can someone more skilled than I please point me in the right direction?- Kaura
- Thread
- Java Recursion Sudoku
- Replies: 12
- Forum: Programming and Computer Science
-
Java Solar system simulator JAVA source code
Hi, I'm developing a very simple solar system simulator for educational purpose. I had taken from wikipedia mass, velocity of planet and applied universal gravitation formula and applied to all celestial corps. It works well, but when I add the moon... the moon is like a planet, rotating around...- sefiroths
- Thread
- Code Java Simulator Solar Solar system Source System
- Replies: 18
- Forum: Programming and Computer Science
-
L
Java What is wrong with my Java array and methods code?
Hello, I am stuck on this java problem. I was wondering if anyone can figure out what I am doing wrong. Thank you! Problem 1. Given an array of ints, return true if there is a 1 in the array with a 2 somewhere later in the array. ex: has12([1, 3, 2]) → true has12([3, 1, 2]) → true...- lypena35
- Thread
- Array Java
- Replies: 13
- Forum: Programming and Computer Science
-
Z
Java 3.15 Program: Text message expander (Java)
I'm having issues with this code, here are the parameters and results. Create a program using conditional logic and string operations that does the following using your NetBeans IDE and upload it here: (1) Use scnr.nextLine(); to get a line of user input into a string. Output that line. (1...- zatawave
- Thread
- Java Program Text
- Replies: 1
- Forum: Programming and Computer Science
-
Java How do I properly reference images in Java?
Here's the snippet I'm erroring on. I'm sure I have a bad syntax or I'm not relative referencing correctly or something. Null pointer. xo = new ImageIcon[2][2]; xo[0][0] = new ImageIcon(getClass().getResource("img/x1.png")); xo[0][1] = new...- BiGyElLoWhAt
- Thread
- Image Java
- Replies: 5
- Forum: Programming and Computer Science
-
Z
Java 3.14.1: Warm up: Text message abbreviation decoder (Java)
I'm working on this code for my programming class and I'm completely stuck. Here is what I have so far but I keep getting error messages. import java.util.Scanner; public class TextMsgAbbreviation { public static void main(String[] args) { String BFF ="best friends forever"...- zatawave
- Thread
- Decoder Java Text
- Replies: 1
- Forum: Programming and Computer Science
-
E
Java Some trouble with File I/O [Java]
I'm trying to write Strings to files in Java. Basically, I'm supposed to read from a file containing text (assumed to be strings). For each line of text, if the String has the format word1 word2 (that is, if it's two words), I have to write it to one file (a list of names), whereas if it...- Enharmonics
- Thread
- File Java
- Replies: 1
- Forum: Programming and Computer Science
-
F
Java Troubleshooting Java Programming in Netbeans: Tips and Tricks for Beginners
Hello everyone, I am new to the forum. Programing was never an interest of mine but it’s an unfortunate requirement for classes I am taking I could really some help. I have tried fixing the code the best I can, but when I run this through Netbeans, no matter what numbers I put in for Wall...- furboll
- Thread
- Java Programming
- Replies: 3
- Forum: Programming and Computer Science
-
E
Java Recursively sorting an array of strings w/o aux. parameter
One of my professor's assignments is proving particularly tricky for me. It reads: "Write the method public static void sort(String[] a) that sorts the array a in increasing order. The method must be a short recursive program. Do not use quicksort or merge sort. It should be a lot...- Enharmonics
- Thread
- Array Arrays Java Parameter Recursion Sorting Strings
- Replies: 7
- Forum: Programming and Computer Science
-
Java Problem with Java Color (setBackground(Color))
Everywhere I read, I see I want this.getContentPane.setBackground(Color); This doesn't work for me. It didn't on the last project either, and I just let it slide thinking I'd figure it out. Now here I am, same problem. Any help would be appreciated. Notes: You might get some "errors". Just...- BiGyElLoWhAt
- Thread
- Color Java
- Replies: 2
- Forum: Programming and Computer Science
-
Java Problem with code, possibly multiple extensions of JFrame
I am making a simple text editor program. You can load, save and exit, and other things. I have the loading and saving working, but the exiting is giving me a peculiar problem. In my project, I have a gui class that extends JFrame, and I also have an ExitOption class that extnds JFrame. I am...- BiGyElLoWhAt
- Thread
- Code Java Multiple
- Replies: 5
- Forum: Programming and Computer Science
-
L
Java Solving a Java Problem: Countdown Rocket
Hello, I am stuck on a Java problem in my textbook. Can anyone help me? I have tried many variations to no avail thank you. Question:Write code that prints: userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after Blastoff!. Ex: userNum = 3...- lypena35
- Thread
- Java Rocket
- Replies: 2
- Forum: Programming and Computer Science
-
Java Java Applet: Moving Image Object
Hello, I'm having trouble with moving an object using an image. I want my image "Car" to move left and right when I press one of the JButtons. As you can see, I included a blue rectangle to kind of show you what I mean by "moving". Here is the code for the Blue Rectangle. private int carY =...- FritoTaco
- Thread
- Image Java
- Replies: 4
- Forum: Programming and Computer Science
-
S
Java Java Help with displaying an array list while using other classes
This is a class assignment that has been puzzling me for a few hours. I need this to print out the values from the passenger array. My code so far prints the values from my aircraft class perfectly but not from my passenger class. Please see my output below: How do I make the output display...- smilesofmiles
- Thread
- Array Classes Java List
- Replies: 2
- Forum: Programming and Computer Science
-
Java Troubleshooting Decimal Inputs in Java Applets
Hello, I am writing a program that takes a users input of how many credits they're taking, and the number of dollars each credit is. The book and parking fee is a constant number (no change). I'm using JOptionPane so users can enter 2 values, 1 for number of credits, and the other for dollars...- FritoTaco
- Thread
- Java
- Replies: 4
- Forum: Programming and Computer Science
-
D
Exponential curve fit using Apache Commons Math
Homework Statement I have the following data which I would like to model using an exponential function of the form y = A + Becx. Using wolfram mathematica, solving for these coefficients was computed easily using the findfit function. I was tasked however to implement this using java and have...- Duo Who Ow
- Thread
- apache Curve Curve fitting Exponential Fit Java Partial derivatives
- Replies: 9
- Forum: Calculus and Beyond Homework Help
-
Java What Issues Am I Facing in Initializing a 2D Array of Objects in Java?
The code I'm working with import java.io.*; import java.util.*; public class ProgressReport{ File file = new File("grades.txt"); Student[][] student = new Student[1][1]; Student[][] add; int[] scores = {0,0,0,0,0}; String name = ""; public...- BiGyElLoWhAt
- Thread
- Java
- Replies: 28
- Forum: Programming and Computer Science
-
Java Probably very easy question about isNaN() java
this is throwing me an error while(! isNaN(s.next())) "The method isNaN(String) is undefined for the type ProgressReport" s is a scanner. I'm just trying to tokenize a text doc of the form int String int ... int ... String int ... int int String int ... int ... String int ... int etc. Oh yea...- BiGyElLoWhAt
- Thread
- Java
- Replies: 6
- Forum: Programming and Computer Science
-
A
Comp Sci Keyword search in a hashmap(using retainsAll) in java
Homework Statement Essentially, I am expected to have a method that can do a keyword search through my hashmap and return respective results. My hashmap is as follows: HashMap<String, Person> phonebook The string as a key is generally the name of the entry. A person object has 3 fields(Name...- Arnoldjavs3
- Thread
- Java Search
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Java Java Platform: 21st Century Users Deserve Better
< rant > For ten years I've had a particular program that has only been released in a version to run on Java 6. That's spanned multiple incarnations of Windows, culminating in Win 10. The developers still don't seem to realize what a giant PITA barrier-to-entry Java is. It's ten years later...- DaveC426913
- Thread
- Java Platform
- Replies: 10
- Forum: Programming and Computer Science
-
A
Java Java: Finding the numbers in an array above the average
I am attempting to find the numbers above the average number of a set of numbers in an array. I am having trouble understanding why my output for the list of numbers above the average is so...weird. I'd appreciate the help! My code: public class Inequality { public static void main(String[]...- Ajmather
- Thread
- Array Average Java Numbers
- Replies: 2
- Forum: Programming and Computer Science
-
Y
HTML/CSS Where Can I Safely Download Java to Open HTML Files?
Hi I need to download Java to open a certain html. I need suggestion of a safe site to download. There are quite a few when I search and I don't want to click on anyone until I know it's legitimate. Thanks- yungman
- Thread
- Java
- Replies: 10
- Forum: Programming and Computer Science
-
I
Java Help with Java Coding: Inputting Integers, Doubles, Characters & Strings
Hows it going MHB. This is my first post and probably will not be my last. I am not going to come here just asking for answers, but to look for help in my coding adventure. I am currently enrolled into a entry level coding course that kind of just jumps right into things and does give some help...- Itisjurrr
- Thread
- Coding Java
- Replies: 1
- Forum: Programming and Computer Science
-
About computers and being good at coding....
i wanted to know how to become computer king of world if we have coding talent like making cool apps,software,making technical software machines like robotics. can we become computer king by challenging bill gates like what they did to world we can do in 1 day not by copying but following...- sukalp
- Thread
- C++ Coding Computers Java Python Ruby
- Replies: 9
- Forum: Programming and Computer Science
-
C/C++ Question about learning C++ Linked Lists before Stacks....
i wanted to ask you that in c++it is important we should learn linked list before learning stack,queue that i wanted to know while studying data structures- sukalp
- Thread
- C++ C++ programming Java Python Rubber band
- Replies: 6
- Forum: Programming and Computer Science
-
A
Other Taking java learning to the next level
Hi, I'm currently a Part time CS student that is looking to further advance his java learning. Right now I'm using The University of Helsinki's free CS course to learn java(my own university's course pales in comparison to this resource...) however I'd like to define my path further. I spend...- Arnoldjavs3
- Thread
- Java
- Replies: 1
- Forum: STEM Academic Advising
-
A
Comp Sci Simple cardgame project in Java
Homework Statement Hi, so I'm working on a project(part 1) where I am supposed to create a simple card game, under a few requirements. Here are the requirements: 1. Write a method boolean hasFlush(String hand) that checks whether the five-card poker hand given as 10-character string is a...- Arnoldjavs3
- Thread
- Java Project
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
A
Comp Sci Potentially simple java methods HW
Homework Statement [/B] So my professor has given this as a lab activity. He has not given any sample outputs, other than these simple instructions. I don't actually understand to what extent I'm to perform this activity to. Write a class BankAccount that contains a double field balance, and...- Arnoldjavs3
- Thread
- Java
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
J
C/C++ Problems with C program- Not C++ and not Java
A user types a word and a number on a single line. Read them into the provided variables. Then print: word_number. End with newline. Example output if user entered: Amy 5 Amy_5 #include <stdio.h>int main(void) { char userWord[20] = ""; int userNum = 0; /* Your solution goes here */...- jasonsmith206
- Thread
- C++ Java Program
- Replies: 2
- Forum: Programming and Computer Science
-
O
Java How can I efficiently replace common text message abbreviations in Java?
Hi everyone, I've been working on this assignment for a few days now with no luck at all. Would anyone be willing to review this code for me and see if I'm even setting it up right? Here are the directions for the assignment. 1) Use scnr.nextLine(); to get a line of user input into a string...- obeying
- Thread
- Java Text
- Replies: 3
- Forum: Programming and Computer Science
-
O
Java Finding Tree Height Using Simple Geometry and Java Coding
Simple geometry can compute the height of an object from the object's shadow length and shadow angle using the formula: tan(angleElevation) = treeHeight / shadowLength. Given the shadow length and angle of elevation, compute the tree height. What I have so far: import java.util.Scanner...- obeying
- Thread
- Coding Geometry Java
- Replies: 2
- Forum: Programming and Computer Science
-
O
Java Reading and printing a string in Java - Assigning values
A user types a word and a number on a single line. Read them into the provided variables. Then print: word_number. End with newline. Example output if user entered: Amy 5 Result should read as: Amy_5 import java.util.Scanner; public class SpaceReplace { public static void main (String []...- obeying
- Thread
- Java Printing Reading String
- Replies: 3
- Forum: Programming and Computer Science
-
O
Java Acceleration of Gravity in Java
Compute the acceleration of gravity for a given distance from the Earth's center, distCenter, assigning the result to accelGravity. The expression for the acceleration of gravity is: (G * M) / (d2), where G is the gravitational constant 6.673 x 10-11, M is the mass of the Earth 5.98 x 1024 (in...- obeying
- Thread
- Acceleration Gravity Java
- Replies: 7
- Forum: Programming and Computer Science
-
Java Numerical integration of an harmonic oscillator using java
Hi, I am trying to analyze the an harmonic oscillator using kinematics. first i calculate the force applied by the spring (f = (-x)*k) then i calculate the acceleration (a = f/m) then speed (v= v0 + v0t + 0.5*a*t^2) and finally update x (x = x0+vt) this is a simplfied loop of my program...- user123897
- Thread
- Harmonic Harmonic oscillator Integration Java Numerical Numerical integration Oscillator
- Replies: 8
- Forum: Programming and Computer Science
-
S
Java Trouble with Buffered Reader and Exceptions in Java?
Hello mathhelpboards community! I can't figure out how to get my code to execute while using buffered reader and try with resources. :-( I created a data.txt file correctly and it contains the numbers "0.5 3 10 70 90 80 20" without quotes. I added a catch IO Exception utilizing the...- smilesofmiles
- Thread
- Java
- Replies: 3
- Forum: Programming and Computer Science
-
S
Java Java- Printing an Original Array while Performing Operations on an Array Copy
Hello mathhelpboards community! Please help! Thank you. :-) I need my code to print out the user's original array that is to say the numbers in the way the user entered them. I tried making a copy of the original array and then did all of the arithmetic on it. I sorted the array copy in...- smilesofmiles
- Thread
- Array Java Operations Printing
- Replies: 4
- Forum: Programming and Computer Science
-
Z
Java How to add elements in a Java swing List Box
Hi, I am using NetBeans 8.1. I want to add elements in a list Box on a Button press. My code would read text from textField & then insert into list box: private void button1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your...- zak100
- Thread
- Box Elements Java List Swing
- Replies: 26
- Forum: Programming and Computer Science
-
E
Java What are the differences between creating graphical programs in Java and C#?
A https://driven2services.com/staging/mh/index.php?threads/18929/ about Java prompted me to ask about graphics in Java and C#, especially from the standpoint of teaching. I know how to create graphical applications in Java using Swing, but I know very little about C#. Swing applications have a...- Evgeny.Makarov
- Thread
- Graphics Java
- Replies: 3
- Forum: Programming and Computer Science
-
Java Why Choose Java: Reasons to Learn Java Programming
I've been wondering a while what are the reasons I should learn Java programming language. Thus far I've mainly seen someone saying how cool Java is and how it is this and that. But. I haven't found it 'cool', or to be honest, useful at all (and I could state that Fortran is cool...). Being...- Theia
- Thread
- Java Programming
- Replies: 8
- Forum: Programming and Computer Science