32,204 Topics
| |
i have questions abou the algorithm that i have got here: [CODE] public class BTreeEx3 { public static void main(String[] args) { BTree tree=new BTree(); tree.add(5); tree.add(6); tree.add(1); tree.add(19); tree.add(3); tree.add(10); tree.add(2); tree.print(); } } class BTree{ private Node head; // why is the head private? public void add(int info){ … | |
I am taking an online java programming class this quarter and the book I have just does not do a good job of explaining anything! The more I read it, the more confused I become! Can someone refer me to an article or site that explains creating methods in terms … | |
I want to use java to access microsoft sql server express remotely.i have allow remote connection in the database that i have.and i allow port 1433 through firewall. the code is: [CODE] import java.sql.*; import java.lang.*; public class Jdbcconn { public static void main(String[] args) { try { //load the … | |
I was reading a program as follows [CODE]import java.util.StringTokenizer; class Tokentester { public static void main(String[] arguments) { StringTokenizer st1,st2; String quote1="Vdef 3 -1/16"; st1=new StringTokenizer(quote1); System.out.println("Token 1: "+st1.nextToken()); System.out.println("Token 2: "+st1.nextToken()); System.out.println("Token 3: "+st1.nextToken()); String quote2="NGNDFBgh 27/32@3/ewtg@tryh@eretgse"; st2=new StringTokenizer(quote2,"@"); System.out.println("Token 1: "+st2.nextToken()); System.out.println("Token 2: "+st2.nextToken()); System.out.println("Token 3: "+st2.nextToken()); } … | |
I want to generate random numbers, display them with ten in a row, and count how many are 1s, 2s, 3s, 4s, 5s, and 6s with nested if/else statement. [CODE] import java.util.Random; public static void main(String [] args) { Random generator = new Random( ); int value = 0; int … | |
In my program I've created two methods , one with integr type and other with float (line # 20 and 29) !! [CODE]class Stack{ int StackArrayI[] = new int[2]; //0,1,2,3,4,5,6,7,8,9 float StackArrayF[] = new float[2]; //0,1,2,3,4,5,6,7,8,9 int tos=-1; public void push(int value){ if (tos==1) System.out.print ("Stack already Full..!\n"); else StackArrayI[++tos] … | |
Simple Reusable Portable (Platform Independent) Distributed Robust Secure High Performance Dynamic Threaded Interpreted aside from those, what else are the fundamental components of java application programs? | |
[CODE]import java.util.Scanner; import java.io.*; public class infixtopostfix { String fname; String output = ""; public infixtopostfix(){ System.out.println("starting infixtopostfix() method..."); getFileName(); readFileContents(); } public int priority(Object x){ if(x.equals('+') || x.equals('-')){ return 1; }else if(x.equals('*') || x.equals('/')){ return 2; }else{ return 0; } } public void getFileName() { Scanner in = new … | |
Since starting this course and seeking to join this forum, I have learned a lot and want to thank everyone for their assistance on my own forum questions as well as those I have read during research in this forum. Having said that I have another array question. I now … | |
I need to make a program to illustrate the Random Class and loop sentinels. So far, I can ask for the input of the number. After that, there are countless logical issues that are coming up. Can anyone help me sort this out? [CODE]import java.util.Scanner; import java.util.Random; public class HiLo … | |
Hello, I'm trying to figure out how to populate an array by using subroutines. We have begun procedures last week, and now this week we are moving onto arrays. College moves too fast sometimes. :( What I'm trying to do is make a subroutine which will populate the entire array … | |
I need to create a custom panel that displays X,0, or nothing, randomly. It is supposed to be something like a tic tac toe board. The only thing is, when you open it it must randomly place the x's, 0's, or blank spaces, and when the screen is resized by … | |
what i am trying to do is this Display the mortgage payment amount and then list the loan balance and interest paid for each payment over the term of the loan. If the list would scroll off the screen, use loops to display a partial list, hesitate, and then display … | |
This is what i have so far.. i've figured out how to do the mortgage payment but I am having trouble displaying the loan balance and interest paid for each payment over the term of the loan. can someone please help with the code and formulas? Here's the code i … | |
[CODE] int [] wronglist = new int [incorrect]; for (int i = 0; i < 6; i++){ for (int j = 0; j < i; j++){ if (studentArray[i] != ansArray[i]) wronglist[i] = (j+1); [/CODE] ok i'm trying to write a program that figures out what number did the user got … | |
hello Friends:; I have question and I wont your help.. I do it,but I'm stuk in printing :icon_cry:.. This the code, I hope you can help ,, Thanks Write a class TelephoneDirectory. It has a telephoneList attribute as a HashMap. The TelephoneDirectory has the following methods: a.addTelephoneEntry ( TelephoneNumber number, … | |
hi.. we really need help on how to d i s p l a y, a d d, s u b t r a c t, m u l t i p l y polynomials. the display should be in ascending order of degree.. and our program should be j … | |
Hi Netizens, I wish you guys can guide me in here. In the following code, I've compiled flawlessly and I didn't managed to get the output screen and I'm kind of in the dark since I didn't find the answer that I wanted through internet browsing after a while. Any … | |
in this program i've pushed 10 values into array but i use the condition [iCODE]if (tos==9)[/iCODE] which means no value should be stored at 10th position but when i am storing values, [iCODE]for (int i=1;i<=10;i++) first.push(i);[/iCODE] [CODE]class Stack{ int StackArray[] = new int[10]; int tos; Stack(){ tos=-1; } public void … | |
I got some problem here..I wanted to generate 6 digits number without repeating into a textbox when the form load in java...but i m stuck and lost here...someone can help me ?? | |
Hallo everybody, Can someone help me with some regexs for testing : - in a textbox , i need to test only string carachters , not numbers,digits, spaces; - in a textbox , i want to text only numbers, not strings, char..other. Please.. Pattern patternForInfo = Pattern.compile("[a-zA-Z]", Pattern.CASE_INSENSITIVE); Pattern patternForNumere … | |
What is the maximum size of one Datagram Packet java makes. Iam implementing my own protocol with defined features which runs over UDP. For every packet i have defined a set of headers. Now these headers are to be defined in every packet. So unless i do not know the … | |
[CODE]import java.util.Scanner; import java.text.DecimalFormat; public class Assignment3 { public static void main(String [] args) { Scanner scan = new Scanner(System.in); String first,last ; int id; //First and last names and ID input System.out.println("Welcome to the Grade Calculator"); System.out.print("Please enter your first name:\t"); first = scan.nextLine(); System.out.print("Please enter your last name:\t"); … | |
I don't know what is wrong with my code here, the if conditions there never run true.[CODE] String words [] = new String[10];{ //Store the word string words[1] = "apple"; words[2] = "ice cream";} String searchData = ""; JTextField mySearchArea = new JTextField(7); public void init() { setLayout(new FlowLayout(FlowLayout.RIGHT,10,10); add(mySearchArea); … | |
Hi everyone, I m running program but got stuck in after if/else if statements, Jpane doesnt show anything.I couldnt figure out. Thanks [CODE]public class FancyGuessingGame { public static void main(String[] args) { Scanner console = new Scanner(System.in); int guess; int num; String name; String Guess; name = JOptionPane.showInputDialog(null, "Please enter … | |
HI All, can any one help me how to convert customize date formats like these below "JAN FY2010" "Q1 FY2010" [CODE]DateFormat df = new SimpleDateFormat("?")[/CODE] as i couldnt find any matching date formats to these. Appreciate your help!!!!! | |
[CODE]public static int totalCorrect(String [] studentArray, String [] ansArray){ int numCorrect = 0; for (int i = 0; i < 6; i++){ if (studentArray[i] == ansArray[i]) numCorrect += 1; } return numCorrect; } [/CODE] instead of returning the actual number, it always return 0. here is the whole program: [CODE]import … | |
For several weeks, I have been trying to wrap my brain around the concept of the paint(Graphics g) method. I have a pretty good idea how it works, but I am still struggling with the "practical" application of the paint method with respect to OOP. I can write small apps … | |
[CODE] public class InnerEx7 { public static void main(String[] args) { Foo foo=new Foo(); Foo foo2=foo.stam(55); foo2.print(); } } class Foo{ String word="bye"; void print(){} // what does this fucntion do. why do i need it if it is empty public Foo stam(final int x){ final int y=10; class Inner … | |
I need help with my sort. it will sort first name but when it gets to last name and DOB it wont. Please help me I tried bubble sort and it didnt work. I would like to use bubble sort. import javax.swing.*; import java.util.Scanner; /** * @(#)program 2.java * * … |
The End.