32,204 Topics
| |
**Hey, Hi all! I'm a bachelor student, new to Java. Following code is giving error in PrintDetails() What parameters should I define in it?? Kindly check and tag out my mistakes in the following code.. Thanks ^_^** class student { String a;String b;char c;double d; student(String name,String rollno,char gender,double gpa) … | |
Could anyone tell where is the error in the program? There is a compile-time error... When I hit compile it shows error in the 40th line saying that 'r' might not have been initialised.. I can't get that.. Pease could anybody help?? import java.util.Scanner; public class Customer_Account { public static … | |
| I need to take arguments and change the extensio of the file for writting but I get java.lang.ArrayIndexOutOfBoundsException: 1 Why? Is there any better way? // change file name for saving the output file int dot = inputFile.lastIndexOf('.'); // check for the dot String baseName = (dot == -1) ? … |
Open the project space in greenfoot and study the codes of the classes Space and Asteroid. 2. Modify the constructor so that the space world paints 300 stars. To paint a star you write the following code: GreenfootImage star = getBackground(); star.setColor(Color.WHITE); star.drawOval(50,50,2,2); this will draw a small white star … | |
Hi. I have problem adding text box after each label ID Code, Weight, Rate, Price Charge, it does not show when i run the code. Also, how do i add the $ sign when display the price charge. the ouput should be like this: Fee Calculator ID Code: [Text Box] … | |
Hey, all I'm working on a homework assignment which includes the creation of an insertion sort method to go through an Array List of basketball games. The basketball games are formatted: public Game (String homeTeam, int htScore, String opponent, int oppScore) { this.homeTeam = homeTeam; this.htScore = htScore; this.opponent = … | |
I'm developing an Intrusion Detection System program....right now, I have written some of the code, but I'm having a lot of difficulty testing it, because I don't have any virus infected systems to test the code on....is there any way I can develop a worm just for testing purposes?...or is … | |
Hello, I am trying to create images from files in a Java ME program, but sometimes the Image.createImage("filename") is returning null without throwing an exception. It works fine for some images but not for others. I've even renamed a non-working image to the same path as a working one, and … | |
hi, I installed NetBeans IDE 7.0 but when I tried run it this message keeps on appearing"see no.1." I tried to uninstall it but an error message also pops-up "no. 2". I tried changing the conf. but it keeps on saying access denied. please guys I need your help >.< … | |
Modify the constructor so that the space world paints 300 stars. To paint a star you write the following code: GreenfootImage star = getBackground(); star.setColor(Color.WHITE); star.drawOval(50,50,2,2); this will draw a small white star at location (50,50) with dimensions 2x2. Draw 300 stars with the same dimensions but at random locations. … | |
I have been using some open source software, like weka/mallet to fulfill certain data analytics works. I know how to use the APIs of these softwares and write customized code under Eclipse. Right now, I would like to learn how to make this type of data analytics work as a … | |
I want to create a java application where you can build simple logic circuits (just started learning java recently and it was just a random project idea I got off the net) Ultimately I want the gates as icons on a pane that users can drag and drop onto a … | |
| I have problem , I only get program to write the frist line but how to write the whole string? When I print that string I get correct ouput? It has 10 lines String fileName = "System.err"; File newFile = new File(fileName); try { if (newFile.exists()) { FileWriter fos = … |
| I have a problem with writting this program I need to read a csv file and write it to binary then read it again. I has to be written in this way: Field name Data type Name First Text Name Last Text Birth Day Whole number Birth Month Whole number … |
This is the instructions Program converts American football plays into scoring points Touchdown – 6 Extra point after touchdown – 1 Field goal – 3 Touchback – 2 Program reads play-name and uses “if-statement” to decide how many points to award Program does calculations in a loop to allow more … | |
So ive been trying to get an average of this array needed, and I seem to be having trouble with it. So far, my current code just adds the numbers up, but doesnt really average them out at all: [CODE]import java.util.Scanner; import java.util.Arrays; public class Grades { public static void … | |
import java.util.Scanner; public class EventFrequency { /** * main method: * ask the user for the average number of events per time interval * (lambda) and the number of time intervals to observe * draw a horizontal and vertical histogram of the number of heads */ public static void main(String[] … | |
This was the assignment: Write a class with methods to help you balance your checking account(an object class-main method is not in this class). The CheckingAccount Class should have at least two instance variables: the balance and the total service charges, along with methods to get and set each instance … | |
Hi Why am i getting error i the below code. abstract class SuperHeroes { abstract void perform(); } class IronMan extends SuperHeroes{ String action="Blowing bubbles"; IronMan(String action){ this.action = action; } void perform(){System.out.printIn(this.action); } } | |
I'm making a connect 4 like game in Java and everything I choose a column to drop the piece it goes where I want it to however, when I want to drop a piece on top of that I, my program throws an error and makes me select another move. … | |
Hello, I was looking for a way to post multipart/form data to a servlet using java standalone application. Any information would be helpful. | |
Hi, I have to write a recursive method to count the number of user entered even integers in an array (the array size is up to 100). Here's what I have.... public static int countEven (int numbers[], int startIndex, int endIndex) { if(startIndex==endIndex) if (numbers[startIndex]%2 == 0) return 1; else … | |
In one class i have a back button(java Swing)...i want when i click this button it will go to another class and close the current class...however, when i use System.exit(0)...it closes both 2 class...if i use setVisible(false) for the current class...that class still running...how can i close the current and … | |
Hi everybody! I made an applet, and was trying to put it in web page. When I run my applet by itself it works fine, but when I'm trying to run it thrue the web page it doesn't work at all. I mean I have just grey box (like a … | |
package com.batch; import java.sql.*; import java.text.SimpleDateFormat; import java.util.ArrayList; import DBConnection.DBConnect; public class Batch { @SuppressWarnings({ "unchecked", "rawtypes" }) public ArrayList BatchAction(String ik) { Connection conn = null; Statement st1 = null; Statement st2 = null; ResultSet rs1 = null; ResultSet rs2 = null; ArrayList al = new ArrayList(); conn = … | |
Hi friends, i was recently started writing a program on java needed for my practicals but as i started i found an error which deletes last element of queue actually i want to delete first element of queue anybody can solve it import java.util.*; class VQueue { int size; int … | |
I'm trying to connect a DB from Postgres with a program in Java. I'm including this code: Class.forName(driver); Connection con = DriverManager.getConnection(connectString, user , password); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM students"); But I'm getting this erros in Statemen and stmt.excuteQuery: With Statement: *incompatible types. Required: … | |
Hi below is an example.I want to know,what does one mean by, 1.create a new class that extends SuperHeroes. 2.have a non static field named: action. thank you. abstract class SuperHeroes { abstract void perform(); } class Thor extends SuperHeroes { void perform() { System.out.println("*Snap your neck with his hammer*"); … | |
Hi every body My teacher assinged us a lab to draw a 200 X 200 square at the top-left corner and the right bottom corner of the monitor then continue drawing squares that become steadily smaller as they are displayed to right side and left side of each preceding square. … | |
I am trying to assign some values to static class and it does not work as I expected. I was expecting to see different values for different classes. However, they fall into the same value because it is static??? See code snippet here: NewOperationResponseSimpleType[] resp=new NewOperationResponseSimpleType[3]; NewOperationResponseSimpleType[] res1=new NewOperationResponseSimpleType[3]; NewOperationResponseSimpleType[] … |
The End.