32,204 Topics
| |
So I'm teaching myself Java. I'm creating a text based game. I have an if statement that i want to check users input so its like this: if(sc.next() = "help"){ System.out.println("info"); } else if(sc.next() = "item"){ System.out.println("info"); } Etc. But it wont work. What would be the proper way to … | |
*Doing the PSEUDOCODE but stuck in the middle. Please help me out.* Scenario: After practicing and learning problem solving skills for an extended period of time, you have decided that life would be easier if you did not need to continue with school. Rather, you decide that winning a large … | |
Creating a text based game. I have a method for each of the following: Race, profession, name. So for instance: public static void main(String[] args) { // TODO code application logic here intro(); name(); System.out.println("Welcome " + name); } public static void String name(){ System.out.println("Enter Name:"); String name = sc.next(); … | |
Hello, I'm trying to calculate the maximum and minimum distance between 10 points. My method to calculate the maximum distance is working fine however my method to calculate the minimum is returning 0.0 and I'm not sure why. Could someone please take a look at my code and tell me … | |
I'm trying to setup the programming environment for Princeton's online course at this website: http://algs4.cs.princeton.edu/code/ However, when I try and run one of the programs I get the following error: /Users/dane/algs4/algs4-2/RandomSeq.java:45: cannot find symbol symbol : variable StdRandom location: class RandomSeq double x = StdRandom.uniform(); ^ /Users/dane/algs4/algs4-2/RandomSeq.java:46: cannot find symbol … | |
Hello, I am making a small application to access WEKA code in Java for Machine Learning. In the code I should specify a data file to work on and mainly it is an Arff file. How to use a file that the user has uploaded/opened or chosen ? | |
package userinput; /** * * @author CHIEF_OGUNDE */ import javax.swing.JOptionPane; public class Main { /** * @param args the command line arguments */ private static void show(string, "Not Yet Implemented"); public static void main(String[] args) { // TODO code application logic here int ERROR_MESSAGE; String first_name; first_name = JOptionPane.showInputDialog("First Name","Enter … | |
Using netbeans IDE 8.0, and have JDK 1.8. Created a project and file that does this. public class Tutorial { public static void main(String[] args) { // TODO code application logic here system.out.println("Hello World!"); } } and when running i get this error... Exception in thread "main" java.lang.RuntimeException: Uncompilable source … | |
10) A statement that creates invokes findAll() based on the argument 8 and assigns this to a new array 11) A print statement that prints out the array created in the above step. Which i did with the following bit of code in my driver ArrayMethods arrayTwo = new ArrayMethods(); … | |
i write code with class f that have constructor : public f(int number){ this.number=number; } i want to write method that get one f then add it with f which the method was called on it public void add(f number) { //the code } what is the code???? | |
Dear all, I am developing SOAP web service using netbeans. As i have got preferred SOAP request and SOAP response,now i want to add security information like username and/or password in my SOAP header Request. Please tell me how can i modify or add username in my SOAP header Request … | |
here where am doing mistake and program is showing error non static method cannot be refferenced to static context | |
hello. I need some help on our implementation on lines of code program. here's the algorithm we have: 1. The LOC program will start by asking for the filename of the program to be counted. 2. Browse for the filename of the program to be used. 3. The contents of … | |
I need the specification and implementation of a new data type that holds terms extracted from document(s). Such a data type will not allow duplication of terms in each instance. A minimum of: 1 creator method, 3 mutator methods, 3 observer methods are required. Also,a separate test program is to … | |
I am trying to figure out how to center the labels labeled blackSection, blueSection and so on. However i am unable to get the labels to center. I have tried blackSection.setVerticalAlignment(JLabel.CENTER) also have tried blackSection.setVerticalTextProperty(JLabel.CENTER). Any help would be appreciated, it is however a homework assignment so hints as to … | |
Does clear use removeAll method for listViews? I have a program that reads a file and stores the data in multiple arrays. I then use that data from the arrays to display them in a ListView, TextFields, a ComboBox, and a TextArea. I am also using an ActionListener to get … | |
hey friend i got a project for bank account which consists fo two child class(saving and current account) i had completed with saving account but in current account i need to have a method type which help me for exrtract money(credit which bank gives us ) example:- if i have … | |
Create a class called Classroom which contains the main method. This class creates an array of 5 students and calls the setName and setAverage methods. Using the console, send in a name and average for every student. Create two integer variables called a and b. a gets a random value … | |
I have been using IntelliJ IDEA IDE for java development for about a year.However, recently I started working on the J2ME platform.However,when using the Oracle J2ME SDK as my project sdk, I can't run a MIDlet.It is working in netbeans but not IDEA.it shows me the following error: `ERROR - … | |
What is the difference between `CoffeeInterface<Beverage> cup1 = new Coffee<Beverage>()` and `Coffee<Beverage> cup2 = new Coffee<Beverage>()` `Coffee` is a class that extends the `CoffeeInterface` Is `cup1` an object or can it be used as one. Are there any differences betweeen `cup1` and `cup2`? | |
I am trying to determine collision in a 2D Side Scroller environment using Rectangles. However, the way most people do it is to get the bounds of the Tile. I do not use Tile's in this case, I am just drawing Simple Full Colored Rectangles using Graphics2D. `g.drawRect(int x, int … | |
I cant figure out how to check the array for AND and OR. please, help, i got stuck my code: import java.util.Scanner; public class BooleanProduct import java.util.Scanner; public class BooleanProduct { public static void main(String[] args) { Scanner input = new Scanner(System.in); int[][] A = new int[10][10]; int[][] B = … | |
Okay, so I have a ListView populated by an Array, which is populated by a text file. I also have 3 TextBoxes which are changed to different values in multiple Arrays using the Selected Index. My problem occurs when reloading the ListView after saving the text file. The values from … | |
i play games that need java to run the games yesterday they all worked fine today none of them work my wife used the computer while i was asleep last night and she gets alot of viruses on the computer sometimes idk how but thats not my problem atm i … | |
I have two classes A Dog class whose constructor does not accept arguments, `public class Dog<pet> extends Animal<pet>{}` whose constructor does not accept any arguments and `public class Animal<pet>{}` whose constructor accepts one argument public class Dog<pet> extends Animal<pet>{ public Dog(){ super(/*what should go here?*/); //Constructor accepts no arguments } … | |
import java.util.Scanner; public class BooleanProduct { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = 10; int[][] A = new int[n][n]; int[][] B = new int[n][n]; //Fill A and B int m,n2,p,q; System.out.println("Enter number of rows for matrix A : "); m = input.nextInt(); System.out.println("Enter … | |
Hi There. Im doing a beginner project here in my studie. So here is the thing. I have a txt file, where there are words in different language. The user must quess the word in his language and if he dosen´t know the word, he should search for it. I´ve … | |
I have two strings, `String one = new String("word");` `String two = new String("word");` Why does `System.out.println(one.equals(two));` Return true given that one and two are two different `String` objects. | |
what do you prefere for naming: database - c++ - java - php? 1- User_id - User_Name 2- user_id - user_name 3- UserId - UserName 4- userId - userName 5- else | |
hi can u please help me solve this question. A small company dealing with transportation has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a program called ReservationSystem to assign seats on a vehicle. Your … |
The End.