Java Definition and 572 Threads
-
M
Java Having trouble compiling my java project. Help?
Hey so I have to compile a project... there are two parts to it, one where I just have to display a series of sentence and another one a bit more complicated... I am using tutorialspoint.com because I don't have any compiler on the desktop at school :/ It is unfortunately giving me this error...- MarcL
- Thread
- Java Project
- Replies: 3
- Forum: Programming and Computer Science
-
R
Java Where Can Beginners Find Java NetBeans Learning Sites?
Are there any sites for learning Java netbeans? For beginners?- Raghav Gupta
- Thread
- Java
- Replies: 9
- Forum: Programming and Computer Science
-
M
Java Java: Questions About Music & App Store Program
Hey so I have to write a program that does the following for my class ( Object oriented programing 1, so basic stuff really...) An online music and apps store offers all apps for 3$ each and all songs for 7$ each. The store requires members to prepay any amount of money they wish, and then...- MarcL
- Thread
- Java
- Replies: 4
- Forum: Programming and Computer Science
-
M
Java Any good websites for learning Java?
I want to develop an Android app but I need to learn Java first. What are some good websites to learn Java?- Math10
- Thread
- Java Websites
- Replies: 7
- Forum: Programming and Computer Science
-
Java (Java) How to make a program that will reload
(Java) How to make a program that will reload without erasing the variable data? How do you make a program in Java that will reload and won't erase the variable values (objects, strings, double, int, arrays and etc.)? And also, what program ideas would you suggest me (beginner programmer) so...- icecubebeast
- Thread
- Java Program
- Replies: 6
- Forum: Programming and Computer Science
-
M
Java Should the project name of my Java application ?
Should the project name of my Java application must be the same as the name when I save my Java application? Because I'm using Netbeans IDE 8.0.2 and in the project name field, I put First Java Program and after I wrote the Java application, when I save it, I put GetStarted.java in the save as...- Math10
- Thread
- Application Java Project
- Replies: 4
- Forum: Programming and Computer Science
-
M
Java How to write a Java application in Netbeans IDE 8.0.2?
How to write a Java application in NetBeans IDE 8.0.2? Do you first go to File at the top and select new project or what?- Math10
- Thread
- Application Java
- Replies: 1
- Forum: Programming and Computer Science
-
M
Java [Java] How come I can't compile this?
I wrote a very simple Java application in Notepad++ and saved it in the Documents inside of File Explorer. Then I opened the command prompt and typed javac GetStarted.java but it says 'javac' is not recognized as... So how do I compile this?- Math10
- Thread
- Java
- Replies: 25
- Forum: Programming and Computer Science
-
Java (Java) I don't get how ".this" works?
I am learning classes and objects, and I don't get how ".this" works in Java. I don't know what it is used for and how to use it. My book that I am learning from doesn't do a good job of explaining how ".this" works. The book is: Java The Complete Reference 9th Edition.- icecubebeast
- Thread
- Java Works
- Replies: 10
- Forum: Programming and Computer Science
-
T
Java Solve Java Selection Sort Issues | Hi, I'm Working on Code
Hi, I'm currently working on my selection sort code, and I've come across some problems. i import java.util.Arrays; import java.io.*; public class SelectionSort { int a[]; static int n; public static void main(String[] args) { int array[] = { 5,3,9,7,1,8 }; n = 6...- tshet
- Thread
- Java Sort
- Replies: 4
- Forum: Programming and Computer Science
-
M
Java What do I need to download/install for Java?
I'm using Windows 8 and I have Notepad++ for coding in Java but I need a development kit for Java that can compile and run Java. I went to the website java.sun.com to download J2SE but it doesn't work.- Math10
- Thread
- Java
- Replies: 2
- Forum: Programming and Computer Science
-
M
Java Can you recommend some good Java books?
Can you please recommend me some good websites for learning Java? Or some books for learning Java? Since I don't have a Mac and I'm using Windows, I want to learn Java in order to develop Android game app. Is the book "Head First Java" a good one for beginners to learn Java? Or would you...- Math10
- Thread
- Books Java
- Replies: 6
- Forum: Programming and Computer Science
-
D
Is IT consultant, Java Programmer considered as professional?
It's a well known fact that those mechanical engineer, civil engineer , EE engineer are regarded as professional. Is IT consultant and computer programmer considered as professional as well?- desmond iking
- Thread
- Java professional
- Replies: 5
- Forum: STEM Career Guidance
-
H
Java Java - Unsupported major.minor version 52.0
I am programming in Java, creating a window application. I used notepad++ and compile through the command line. The program compiles and runs fine through the command line However I want to create an executable file, so I downloaded jsmooth But it is giving me this error and I can't really...- hzp
- Thread
- java
- Replies: 3
- Forum: Programming and Computer Science
-
C
Comp Sci How to Create a Java Program for Generating Custom Passwords?
Homework Statement import java.util.Scanner; import java.util.Random; public class Passwords { public static void main(String[] args) { Scanner in = new Scanner(System.in); Random r = new Random(); System.out.println(" Password...- Cia
- Thread
- Generator Java
- Replies: 37
- Forum: Engineering and Comp Sci Homework Help
-
J
Java Why does the output show 1 and not 3?
Consider the following java code int a=1; if (a != 0) { int a=3; } System.out.print(a); What is the output A. 0 B. 1 C. 3 D. No output. A compilation error occurs The answer is B. I want to ask why the output shown will not be 3. As the 1 is not equal to 0, should the ' int a '...- jackylaucf
- Thread
- Choice Code Java Multiple Multiple choice
- Replies: 4
- Forum: Programming and Computer Science
-
P
Comp Sci Using methods in java programming
We are asked to make a program to prompt the user to choose between calculating the perimeter of a circle or triangle. We are supposed to use at least 5 methods. I believe I have created the appropriate methods but my real problem is with method calling.Homework Equationsimport java.util.*...- preceptor1919
- Thread
- Java Programming
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Intro to Java book for scientific computing?
Hey everybody, I need to learn Java for a course I'm taking in the spring(my C++ course fulfills the prereq for our java intro to data structures course) and I need to get a working knowledge of java. I've been reading the book for the class I'm not taking, but it's essentially built around a...- \Theta
- Thread
- Book Computing Intro Java Scientific Scientific computing
- Replies: 5
- Forum: Science and Math Textbooks
-
C
Java Trying a String exercise in JAva
I am trying to capitalize the first letter of every word in a sentence. Example. "hey what's up" would be "Hey What's Up". here is my code but nothing is changing the sentence. I thought everything was right. public static String cap(String aString) { String[] sentence = aString.split("...- camel-man
- Thread
- Exercise Java String
- Replies: 2
- Forum: Programming and Computer Science
-
K
Comp Sci Programming assignment question (Java)
I'm not sure if I came to the right place/forum to ask this question, but I have a programming assignment and I need help on one of the question. It's part of the Peking University's online judge questions. It shouldn't be hard for people who understand it. Link: http://poj.org/problem?id=1005...- kevinshen18
- Thread
- Assignment Java Programming
- Replies: 11
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci Java - Importing .csv file for calculating selected averages
1. Problem: The task is to import an excel (.csv) file containing monthly weather data and produce a programme that can execute different averages on a yearly basis. i.e.;, produce average rainfall, maximum or minimum temperatures for desired years. I have thus far managed to calculate average...- SalfordPhysics
- Thread
- File Java
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
F
Java I'm unsure why java won't recognize radius and height
Why is this java code wrong? I'm unsure why java won't recognize radius and height. Both should be fields for any object of the Cylinder class. My declaration for PI may be off, but that doesn't produce an error. public class Cylinder { public static final double PI...- friendbobbiny
- Thread
- Cylinders Java
- Replies: 2
- Forum: Programming and Computer Science
-
C
Comp Sci Saving string to text file in Java IO
Homework Statement Hey everyone, I have a question regarding file IO in java. My assignment says: Extend program 2-add menu items Open(reads employees from a file),Save(writes employees to a file already specified), and Save As(writes employees to a new or different file than the one...- concon
- Thread
- File Java String Text
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Java Old Dos program (Wa-tor) ported to Java runs too quickly
When I was a (very lonely) child, I used to play endlessly with this predator-prey simulation game: http://www.leinweb.com/snackbar/wator/ (You may have trouble getting this applet to run based on java updates, other security settings and what not). There is more information about it here...- dkotschessaa
- Thread
- Dos Java Program
- Replies: 10
- Forum: Programming and Computer Science
-
S
Webassign Find Strength of Magnetic Field using Java App
Homework Statement A 10nC, 1µg particle is fired into a magnetic field as shown. Distances are in millimeters, time is in seconds. What is the strength of the field? (See my picture for additional information and my worked solution) Homework Equations f= mv^2 /r F(from B field) =...- SchrodingersMu
- Thread
- App Field Java Magnetic Magnetic field Strength
- Replies: 1
- Forum: Introductory Physics Homework Help
-
B
Java Can't make natural logs work in java?
I'm trying to learn java. So I'm practicing what I've learned so far by making a calculator to do formulas I learned in my finance class. But it's not working right now. case ("loan length"): Scanner inp_ll = new Scanner(System.in); System.out.print("What is the monthly...- breebreebran
- Thread
- Java Loans Natural Work
- Replies: 7
- Forum: Programming and Computer Science
-
N
Java What are the key concepts to learn for Java?
New to programming Java please list out the things I should focus on. What are the key ingredient to programming in Java? Thank You- Niaboc67
- Thread
- Concepts Java
- Replies: 4
- Forum: Programming and Computer Science
-
W
Java Java While Loop and If statement
I am reading an input file that has blank lines. x reads character by character. x is equal to a new line so it goes into the while loop but skips the if x == '\n'. It's suppose to go inside the if statement but it doesn't. I tried debugging the code and printed out to double check x is holding...- whitehorsey
- Thread
- If statement Java Loop
- Replies: 8
- Forum: Programming and Computer Science
-
Java Why can't I open java applets on my computer?
Can't open java applets :( I just visited thishttp://www.astro.ucla.edu/~wright/Balloon2.html and found that I can't open the java applet. I encountered this: Then I tried opening applets from other websites and tried using firefox.This is the result from firefox and chrome. From where can...- adjacent
- Thread
- Java
- Replies: 10
- Forum: Programming and Computer Science
-
C
Java Question on instructions for Java
Can someone tell me what they think this is referring to? On the create event for a form add 3 animal instances to a list. A form just meaning a GUI? and what does it mean on the create event? Clicking something to add the animals perhaps?- camel-man
- Thread
- Java
- Replies: 2
- Forum: Programming and Computer Science
-
H
Comp Sci Problems With Sorting A Linked List In Java
Homework Statement Create a SortedLinkedList class which implements the LinkedListInterface. Remember to use the Comparable class Basically, I need to implement a sorted linked list that uses generics and uses compareTo to sort objects. I need it to be able to sort names...- heatengine516
- Thread
- Java List Online classes Sorting
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
Java How do I iterate and enter values from a mapped entrySet into an array?
Using the following code: Set<Map.Entry<String,JsonElement>> mySet = jsonObject.entrySet(); for(Map.Entry<String,JsonElement> singleItem : mySet) { singleItem.getKey(); System.out.println("Set values: " + mySet); } mySet gets printed to the console as: Set values...- iamjon.smith
- Thread
- Java
- Replies: 1
- Forum: Programming and Computer Science
-
Java What is the Best Way to Decode a JSON Object in Java?
I have a JSON Object being returned to a .jsp page. the object comes back...- iamjon.smith
- Thread
- Java
- Replies: 5
- Forum: Programming and Computer Science
-
F
Java How to Change Default Comment Block in Java with NetBeans 7.4
I'm new to Java. My high school CS teacher requires an MLA-style comment block before the first package declaration in our programs, I was just wondering how I might change the default opening comment block. I'm using NetBeans 7.4. I did some searching and I couldn't find much help. I mean I...- Fifty
- Thread
- Java
- Replies: 1
- Forum: Programming and Computer Science
-
V
Comp Sci Having trouble with last part of JAVA programming assignment.
You have been commissioned by the US Navy to develop a system for tracking the amount of fuel consumed by fleets of ships. Each ship has a name (ex: "Carrier"), fuel capacity (the maximum amount of fuel the ship can carry), and amount of fuel currently onboard. In this problem, fuel is measured...- vysero
- Thread
- Assignment Java Programming
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
Java Coding in Java - replacement for a global variable
I was forced into learning Java. I feel reasonably fluent in C++, so the main problem is with the differences between the way languages are designed. There are no global variables in Java. However, I need one - or at least some equivalent. I have something like a database object that I want...- Borek
- Thread
- Coding Global Java Variable
- Replies: 18
- Forum: Programming and Computer Science
-
T
Java Sine wave equation into Java Code
I have been trying to implement this Wave equation into java: A = amplitude of wave L = wave length w = spatial angular frequency s = speed wt = temporal angular frequency d = direction FI = initiatory phase Y(x,y,t)=A*cos(w *(x,y)+ wt*t + FI; I...- TastyLemons
- Thread
- Code Java Sine Sine wave Wave Wave equation
- Replies: 1
- Forum: Programming and Computer Science
-
Java Can This Java Code Generate Dynamic Game Environments?
Hello I am not a programmer or anyone. I want to make a game based this code public int[] createBackGroundMap2(int paramInt1, int paramInt2) { int[] arrayOfInt = null; if (paramInt2 == 4) { arrayOfInt = new int[] { 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2...- adjacent
- Thread
- Java
- Replies: 8
- Forum: Programming and Computer Science
-
K
Comp Sci Solving Heapsort in Java: Understanding Index Values
Homework Statement Develop a Heapsort algorithm using java Homework Equations The Attempt at a Solution I have been trying to implement HeapSort in java. Unfortunately I am running into errors. I am printing out the index values and they go up then down and the code does not sort properly. Can...- kmr159
- Thread
- Index Java
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
W
Java How do I use touchlistener to load new images on my Java Android app?
On my app there are two rows that holds 3 images each (as seen in the image attachment). In the beginning, the 6 images are loaded and then when a person touches one of the images I want the other 6 images to be loaded. It's a series of choices. Ex. First 6 images would be to pick what day it...- whitehorsey
- Thread
- Android Java
- Replies: 5
- Forum: Programming and Computer Science
-
W
Java Java Multiple Constructors Question
In the main activity, I call one of the constructors: public Something() { //nothing initalized } public Something(7 variables) { ... (this.variable = variable) } public Something(10 variables) { ... (this.variable = variable) } I call the 7 variable one but the...- whitehorsey
- Thread
- Java Multiple
- Replies: 11
- Forum: Programming and Computer Science
-
D
Java Java - Are methods instantiated or initialized?
I tried searching difference between instantiation and initialization but all results were about either variables or objects. But what about methods? Are methods instantiated or initialized? static methods? instance methods? Thanks- Deathfish
- Thread
- Java
- Replies: 2
- Forum: Programming and Computer Science
-
C
Comp Sci Java simulation of solar system
Homework Statement I am creating an astrophysical simulation involving an arbritary number of particles and each particle is identified via a mass, label, position vector and velocity vector. I have made classes which can perform operations on these vectors and I also have a class which...- CAF123
- Thread
- Java Simulation Solar Solar system System
- Replies: 15
- Forum: Engineering and Comp Sci Homework Help
-
W
Java How to make a Java Program to display an image?
How would I create a java program to display an image?- whitehorsey
- Thread
- Image Java Program
- Replies: 2
- Forum: Programming and Computer Science
-
C
Java Java error with variable initialization
import java.util.Scanner; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; public class CountryPopulationReverse{ public static void main(String args[])throws FileNotFoundException { //Variable...- camel-man
- Thread
- Error Java Variable
- Replies: 3
- Forum: Programming and Computer Science
-
C
Java Cant get the outputfile in Java program
Im using Eclipse and I have an input file name that I am reading from but for some reason when the program ends there is no output file that gets created? Does anyone know what I am doing wrong here? import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter...- camel-man
- Thread
- Java Program
- Replies: 3
- Forum: Programming and Computer Science
-
D
Java [Java] If-else involving strings
I have an if-else piece of code involving strings String color = sc.nextLine(); if (color == "R" || color == "r"){ System.out.println("red"); } else if (color == "G" || color == "g"){ System.out.println("green"); } else if (color == "B" || color == "b"){...- Deathfish
- Thread
- Java Strings
- Replies: 5
- Forum: Programming and Computer Science
-
D
Java Java rule on Methods with multiple parameters
Let's say a method or constructor has multiple parameters example in DecimalFormat -- public final StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) if you don't declare all of the parameters, what happens to those that are not...- Deathfish
- Thread
- Java Multiple Parameters
- Replies: 3
- Forum: Programming and Computer Science
-
D
Java Urgent: Resolve Java Error - Single Quote Character Outputting æ
Hi, I am programming a command line program in Java. When I try to use System.out.print to print a single quote character, it outputs æ instead. So I get output like Johnæs height is 1.72 m instead of John's height is 1.72m I tried using escape sequence and i get illegal escape...- Deathfish
- Thread
- Java Quote Urgent
- Replies: 5
- Forum: Programming and Computer Science
-
J
Java Is there anything wrong with this Java code?
I had a phone interview with a guy and I thought it went well. At the end he told me to send him a Java program that reads from a file containing a list of integers, one per line, and prints out all the pairs that sum to 8. I thought I made a pretty good algorithm that finds all the pairs that...- Jamin2112
- Thread
- Code Java
- Replies: 11
- Forum: Programming and Computer Science