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...
I am having a difficult time with methods in java. I've been able to get my program to run correctly without methods. My for loop does as intended by printing an alternating rectangular pattern with no separator at the ends. However, after trying to decompose my code into 3 methods I've hit a...
Hi.
I have lots of bookmarks to splendid physics Java applets, but most of them are a bit dated. Many of them get blocked by current Java versions. To make them work I have to go to the Windows control panel, open Java control panel, add the page to the exception site list and restart the...
Homework Statement
I decided to take a Java class so I can introduce my students to programming/java next year as part of an after school program. I am stuck! My code works except for the last part. It is in bold. Honestly, I am lost. I'm sure it is a simple solution but I can't see it. Any...
For what it's worth, i created a little java program in relation to the clique problem
https://en.wikipedia.org/wiki/Clique_problem
The idea was, to play around with it and maybe discover some better algorithm than the known ones used to discover all maximum cliques
The code is quite small...
Dear friends!
Please explain me what API/Libraries uses in Java for create graphic user interface. I use SWING but I hear that SWING is oldest technology. What you uses?
I was searching for a good website or an app that can teach Java.I found so many of them and they were pretty uninteresting.They don't teach from the scratch and I get so annoyed.And even in those videos that start from the scratch,it is very very slow that I feel why can't the teacher be...
Essentially, my problem is to: design a program that takes the following information:
-a persons ID
-a houses ID
-listing price of house
-selling price of house
and write the input to a text file, called Sales.txt. Secondly, based on the list and selling price, commission is calculated based...
I like to learn Physics related to my career. I'm a software Engineer with good development experience in Java.
Looking to find ways how can I use Java with Physics
I can't get this to test all the way through
import java.util.Scanner;
public class OrderStrings {
public static void main (String [] args) {
String firstString;
String secondString;
firstString = "rabbits";
secondString = "capes";
if...
Hello everyone. I am a computer science and applied math double major. I want to get involved in an open source project so I can gain experience and so I have something to show potential employers that I worked on. I just created a GITHUB account and I am not an expert at using it, nor have I...
Hello PFers,
I'm trying to make a program in java which process user's position, initial velocity of the projectile and the elevation of the projectile and show the trajectory in GUI. The language is in java.
The problem is, the trajectory won't show. It is supposed to show the player's...
Dear Friends,
I am new here and I would like to ask you for an advise. I have the opportunity to start a scholarship with a good school with Cambridge International Certificate.
At this school I have opportunity to choose one of two modules: PHP Web Development or Java Development.
I worked...
I am writing code in both Java and Python, and am a little confused about one thing: casting. In Python, we cast data types by using int(), str(), float(), etc. These are functions which convert one data type to its representation as another data type. However, in Java, it doesn't work like...
I am having some issues understanding the fundamentals of Java and OOP. In simplest terms possible with an example can you explain to me what an Object, Class and Method are? I am confused on what these actually are.
Thank you
Hey all,
So I just graduated community college with an associates degree. The program is essentially a chemical technician program. I'm currently employed at an agricultural company, but the job is not very mentally stimulating. I was thinking of pursuing a continuing education program...
Been working this problem for hours and can't seem to get it right. Any assistance would be greatly appreciated!
Note: Green colored text is the editable text
public class CheckingPasscodes {
public static void main (String [] args) {
boolean hasDigit = false;
String passCode =...
I am programming in Eclipse and I keep seeing the error "
Type mismatch: cannot convert from int to String", not only in the example I am going to provide but other programs. I've just started programming in Java. Could someone explain to me what this error exactly means?
publicclassPracOne{...
Looking for some assistance with this. I've been messing with this for hours and can't seem to get it right. Some assistance would be greatly appreciated. What I have below is not correct. Material in green cannot be changed. Thanks!Print "Balloon" if isBalloon is true and isRed is false. Print...
I spoke with my adviser about this he said "have you ever programmed in Java before? because you could CLEP out into the following course" I told him I have programmed very little in Java. Now my life was a bit shattered when I realized the wait-lists for this class were too much to get in. So...
:oldsmile:Do you know how to make a musical note in Java without using any external library ?
In C# I can simply do this :
Console.Beep(50,1000); //play a sound at 50Herz of frequency within 1 second
Homework Statement
Determine if two circular objects (both moving or one stationary), collide and if so, determine their final velocity.
The two objects are being rendered using Graphics's Java library class, updating their position 60 times per second. Their position (x,y) is determined based...
Sorry for the disturbance,
So I have been looking (without success) for a way to define a variable within an implicit function in Java. What I really mean by this is I have the equation:
In this function my program will give me all of the values except for px. I have tried rearranging the...
Hi everyone... I'm a communication system engineering student and in my university we use studying Java. Now, for this summer, when I ll have free time, I was thinking about doing some practice with programming and maybe studying a new language, such C++( it s still a widesprrad language and I...
Ok guys, I am working on a simple serialize/deserialize project. A user interface takes the following input:
A Department ID (INT), A Department Name (String), and Three Employees (ArrayList) that have a Name, Department, and Salary. Once the Three employees are entered, the Department can be...
I applied at an internship for the position of a Junior Java Developer in Test and I am wondering if you can provide me some screening question examples?
The internship requires that I have strong knowledge in SQL and Java. I asked the recruiter to elaborate on the technical interview questions...
Hello, I have a working calculus library for java and want to use it in a program. I don't have very many ideas. I have limited Calc. II knowledge but a strong understanding of Calc. I. I have an intermediate understanding of java (took 3 courses at my high school of it), and a solid algebraic...
Let a file on disc comprise the bytes "Hello World".
If I open the file in Java as a RandomAccessFile and write the character "X" over it from the start of the file to it's end, will the original disc block be overwritten? Or, will the original block containing "Hello World" be marked as...
Hi everyone,
I am a mathematics undergraduate and I'm currently doing an internship at the informatics department of a university. I am well and truly out of my depth. My supervisor has assigned me tasks which include Java (a language I'm having to quickly pick up, having only used python/R)...
Homework Statement
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million...
Homework Statement
http://pastebin.com/aS3vTR2V
Homework Equations
N/A
The Attempt at a Solution
I'm confused about what I need to do for the BlobFinder constructor. Someone told me that I should “initialize the ArrayList blobs”, then “create a 2D array of booleans called marked, having the...
I am applying for a junior java internship and the recruiter told me there is going to be a math based interview question that I must code. What can I expect from this math based question? Are there general math questions that you can provide me so that I will have a good understanding of what...
Generate 225 samples of size 625 random numbers from U(10,22). For each of these 225 samples calculate the mean.
a) Find the simulated probability that the mean is between 10 and 11.
b) Find the mean of the means.
c) Find the standard deviation of the means.
d) Draw the histogram of the...
Homework Statement
You are provided the following list that contains (semi-random) years from modern history. Save the list to a text file named “events.txt” Write a program that: 1. Reads in the file “events.txt” 2. Sorts it with the latest events first 3. Determines whether the founding of...
Homework Statement
I am implementing a singly linked list but when I am in my main method, to add into my singly linked list, nothing happens.Homework Equations
[/B]
None
The Attempt at a Solution
I am trying to implement a singly linked list.
My singly linked list, where I implemented a...
Homework Statement
If I have a subclass that implements a set class how can I avoid having to override all the set classes methods?
Homework Equations
None
The Attempt at a Solution
I have an interface:
import java.util.Set;
/**
* An extended Set where there is added...
Hello, I haven't used the for loop in Java much, so I have a question. How do you put multiple statements inside the initialization, condition, and iteration portions of the for loop?
I was coding and I came across this error:
Exception in thread "main" java.lang.Error: Unresolved compilation...
Write a Java program to find the sum of all numbers between 1 to 10.
So we all know that 1+2+3+4+5+6+7+8+9+10=55 and that answer to this problem is 55. Please check my work below:
public class Standard
{
public static void main(String[] args)
{
// Create a for...
Homework Statement
How do I take the union between an object called on and the object passed in the parameter?
Homework Equations
None
The Attempt at a Solution
I have an interface:
import java.util.Set;
/**
* An extended Set where there is added functionality
*
*...
. Homework Statement
A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first student, denoted S1, opens every locker. Then the second student, S2, begins with the second locker, denoted L2, and closes every other locker...
Homework Statement
I want to redefine the FileNotFoundException by creating a new class which extends it, but I am having difficulty. For my class practice, if no file is selected or passed in, an UnknownFileException should occur.
Homework Equations
None
The Attempt at a Solution
My code...
Hey so I have to make a pattern in the shape of a diamond as follow:
1
123
12345
123
1
So first, I wrote the code without using a variable n as the number of rows ( from an input from the user) but just the constant i = 5 ( I am sorry for the variable names, I made many patterns and...
Homework Statement
How do I read in a file line by line into an array without using arraylist?
Homework Equations
NoneThe Attempt at a Solution
I know how to do this using BufferedReader, but I am wondering how to do this using Scanner? When I used BufferedReader I noticed that there must...
Homework Statement
[/B]
I would like to make a physics applet.
I have a numerical solution of the Lotka-Volterra model located here:
https://www.physicsforums.com/threads/lotka-volterra-model-eulers-method.803382/#post-5044961
Homework Equations
None
The Attempt at a Solution
[/B]
I want...
I am trying to view some possibly old java applets on this site:
http://aleph0.clarku.edu/~djoyce/java/elements/bookI/bookI.html
I keep getting promoted that they are blocked. I have tried to add this site to the exception list but it has not changed anything. I closed all pages, and have since...
Homework Statement
How do I create an instance of a class in a method?
Homework Equations
None
The Attempt at a Solution
I am a bit rusty whenever I think of instances. I always think of main method and objects when I see instance which gets me confused on what to do with the following...
Homework Statement
Suppose I have a subclass called, Cashier, and a super class named, Clerk. How do I make a method that is called on a Cashier object and takes in an instance of Cashier? What method has a structure like this? Homework Equations
NoneThe Attempt at a Solution
This method is...