32,199 Topics
| |
Hi. I can't figure out how to remove an element from an array. will I have to move get the element to be removed and swap it out with the last element and use the pop()? | |
Hello, I am a current Java student and am having a problem when I run my compiled program from an in chapter lab assignment called "Stock Tracker". I receive a message from a dialog box "Cannot locate sun.jdbc.odbc.jbcOdbc Driver. Class not found exception creating database object. Following are a list … | |
[CODE] public class Reservation { private String firstname; private String lastname; private String address; private String name; private int licenseN; private String date; private int daysN; private String type; public Reservation(String f,String l,String a,int lpn,String dt,int nd,String tp) { firstname = f; lastname = l; address = a; licenseN = … | |
Hi, I have a jsp web application running in Tomcat 6 that uses a set of 3rd party jars. One of the jars is attempting to load a log4j property file by using a relative path. ( \folder\.properties) I have the property file but I need to know where to … | |
Ok so Im trying to create a constructor that reads input from a text file. Which I got it to do. Then adds the information to a LinkedList. [CODE] public class CourseCatalog<T> { private BufferedReader read; private LinkedList<Course> catalog; public CourseCatalog(String filename) throws FileNotFoundException { catalog = new LinkedList<Course>(); try … | |
Can anybody help me how to transfer the inputting of my numbers from left to right... Well here is my program.. [code] import java.awt.*; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; public class Calculator2 extends JPanel implements … | |
Hi! I have a project in school about a grocery list...can someone help me make a code for this? I really need it....thank you so much! here's the problem: This application is called the “DAWLIMs Grocery Store”. The team has closed a contract deal to develop an application of a … | |
I have a tree, and I want to find the depth of it. For example for this tree: [CODE]0 root / \ 1 5 1 / \ 2 1 3 | 3 2[/CODE] It should give a depth of 3. [CODE] public int getDepth() { int maxDepth = 0; if(this.hasChildren()) … | |
Okay so I have to have write a program that takes website names until you type stop. After that it should count how many websites were entered. [CODE]package website; /** * * @author */ import java.*; import java.util.Scanner; public class Main { /** * @param args the command line arguments … | |
Does anyone know how to hack passwords, like Facebook or email through Java? | |
[CODE]public double returnTotalFine(){ if (parkingmeter.returnPurchasedMins() >= parkedcar.returnMinsParked()){ fine = 0; } else if (parkingmeter.returnPurchasedMins() - parkedcar.returnMinsParked() <= 60){ fine = 25; } else{ fine = (25 + (10 * (parkedcar.returnMinsParked() / 60.0))); } return fine; } [/CODE] this is the toString method from the same class as above: [CODE]public String … | |
| Here's the pattern: [CODE]******* ***** *** * ** *** ***** ********[/CODE] Here's the code I used to get only the first part(the up-side down triangle): [CODE] class hourglass { static void pattern() { for(int j=1;j<=4;j++) { for(int i=1;i<=j;i++) { System.out.print(" "); } for(int i=7;i>j;i--) { System.out.print("*"); } System.out.println(); } } … |
Hi, I wanted to know how you can link two list Boxes together. This is what I'm trying to do: [B]I'm creating two list boxes, list box A and list Box B. List Box A is a list of different departments. When the user clicks on a particular department, the … | |
hey guys, just one question- how do i get netbeans to import a whole folder (containing numerous java files)? the only option i currently get is to import eclipse projects. | |
[code] package cls; public class main34 { public static void main(String[] args) { for(int i = 2; i <= 100; i++) { for(int j = 2; j <= i; j++) { if(i % j == 0) { break; } else { System.out.println(i + " "); } } } } } … | |
i am trying to send AT commands on a GSM modem. this is my code.. [CODE]import java.io.*; import java.util.*; import javax.comm.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String commands[] ={"AT+CMGS=1","AT+CMGS=\"+919007413343\","Hello there"}; static byte[] newline[]={(byte)13,(byte)10}; static SerialPort serialPort; static OutputStream outputStream; public static void main(String[] args) … | |
I am trying to make a program that outputs a triangle and the program then should asks the user to enter the size of a triangle to print on the screen. After getting this number, the program should then print a triangle to the screen by printing a series of … | |
public class Strength3 extends ConsoleProgram { private static String[] blank; private static String it; public void run(){ blank = new String[5]; for (int i=0; i<5;i++){ blank[i] = "-"; it+=blank[i]; } println(it); } } why does it print 'null' first. all i want is just 5 hyphens...thanks | |
how to make video lecture application??have any idea??help me please :'( | |
hi... I have some questions... Firstly, I have an ArreyList that is stored two String "Name", "Description" This is a database of students [CODE]private void addStudents () { addStudent("ABC","lalala"); addStudent("DEF","hohoho"); }[/CODE] I also have the methods that adds, modify and delete students from the term list. [CODE]protected boolean addStudent (String … | |
Hi everyone.... I want to develop a music lexicon (tyoe band name --> give description) and I want to add terms (bandName and description) I use ArrayList but I want to change. I have also the code that read a [B]text [/B]file (bands.txt) but I dont know haw it works... … | |
Firstly... I am a new in Java... I have a music dictionary that use an arreylist to store the terms and definition The user use the terminal to interact with this dictionary. [CODE]private void addTerms () { addTerm("Anathema","Atmosheric metal band from Liverpool, UK." } [/CODE] Because, I would like to … | |
hello friends i m larning core java.i want some write code of some program by in which i can use the concept of opertors,inhertance so plz me assignment so that i can do practic. | |
I'm trying to see if someone can help me with two issues with my program. It compiles fine without errors, but some of my numbers in my amortization table only gives me one number after the decimal place and others give me two numbers. I was wondering if something in … | |
i need to get the output of 1 2 4 7 11 16 22 i know im on the right track however i cant figure out a way to get the outputs in the right form like 1+2+3 etc like its doing in the output i should get. i know … | |
How can i right shift a binary number and display all of the positions in java ? | |
Write a Java program to continue creating your own userdefined methods and introduce some do while loops. Write two valuereturning methods called farToCel() and celToFar(). These two methods will convert temperatures from Fahrenheit to Celsius and Celsius to Fahrenheit respectively. They will each take a single int parameter and return … | |
Hi! Could someone please help me to solve one more problem. To read the data (ArrayList) from file, I'm using the following code, which assumes that columns are separated with ",". It works perfectly: [CODE] public static List<UserDataRow> readData() { List<UserDataRow> listofusers = new ArrayList<UserDataRow>(); FileInputStream fstream = null; try … | |
I know this probably doesn't make any sense, but I'm going to try. I have a GUI I created for a checkbook balancing program. And I have an account class with a few extended classes (savingsAccount, checkingAccount, etc). I want to use the GUI I created with the account classes … | |
program test whether the given integer is perfect or not i dont know why there is some error and how to solve it? [code]class perfect { public static void main(String args[]) { int a=o; int n; for(int i=1;i<=n;i++) { if(a==n) System.out.print("Perfect number"); else System.out.print("Not a Perfect number"); } } }[/code] |
The End.