Showing results 1 to 18 of 18
Search took 0.01 seconds.
Posts Made By: JConnor135
Forum: Java Jul 21st, 2008
Replies: 3
Views: 174
Posted By JConnor135
Re: Npe please help!!!

sorry, I just cant figure this out, I know that head isnt pointing to anything, I just dont know how to get it to point to the first node.
Forum: Java Jul 21st, 2008
Replies: 3
Views: 174
Posted By JConnor135
Npe please help!!!

Can someone please help me find out why I am getting a nullpointerexception for this code. Ive been racking my brain and cant find it for the life of me. The program is supposed to delete an...
Forum: Java Jul 20th, 2008
Replies: 10
Views: 418
Posted By JConnor135
Re: linked list help

do you know what he means by putting the code in the main method? I cant put a method in a main method?
Forum: Java Jul 20th, 2008
Replies: 10
Views: 418
Posted By JConnor135
Re: linked list help

It also says the program should take a linked list and integer n. So I think I have to write it like this:
public void delete_nth(IntNode list, int n)?
Forum: Java Jul 20th, 2008
Replies: 10
Views: 418
Posted By JConnor135
Re: linked list help

I see what you mean with it being null. Maybe it is the way that I am writing the code. Here is what the assignment is and there is one part of it that might be throwing everything off.

"Write a...
Forum: Java Jul 20th, 2008
Replies: 10
Views: 418
Posted By JConnor135
Re: linked list help

The way that I declare the list in the main method is:

public static void main(String [] args)
{
int n;

//Declare a list
IntNode1 list1 = new IntNode1(0, new IntNode1(1, new IntNode1(2, new...
Forum: Java Jul 20th, 2008
Replies: 10
Views: 418
Posted By JConnor135
linked list help

For this code to delete an element from a linked list how do I get the head to point to the first element in the list(which is 0)?

public class IntNode1
{
public int item;
public IntNode1 next;
...
Forum: Java Jul 20th, 2008
Replies: 7
Views: 254
Posted By JConnor135
Re: help please

no, I get how the linked list works, there are 2 parts to every node containing an element and the address to the next node, so if you have the address to the first node you can access every node in...
Forum: Java Jul 20th, 2008
Replies: 7
Views: 254
Posted By JConnor135
Re: help please

I just rewrote using a for loop this time and when I run the program I get IntNode1@1d31859, which I think corresponds to that elements address in memory?

import java.util.*;

public class...
Forum: Java Jul 20th, 2008
Replies: 7
Views: 254
Posted By JConnor135
Re: help please

ok, so it is a singly linked list where the node consists of a part to store the element and a link to the next node
Forum: Java Jul 20th, 2008
Replies: 7
Views: 254
Posted By JConnor135
Re: help please

I need to make a linked with the integers 0-8, so Im pretty sure that it needs to be cicular. Im actually missing the 0 int in the list that I built in the main method(just put it in), but it doesnt...
Forum: Java Jul 20th, 2008
Replies: 7
Views: 254
Posted By JConnor135
help please

I am trying to write a program that will delete the nth element from a linked list. Before I was getting a nullpointerexception but I think I cleared that up. Now I just get a repeating error...
Forum: Java Jul 19th, 2008
Replies: 1
Views: 225
Posted By JConnor135
nullpointerexception

Hi, I am trying to write a code that will delete an element from a linked list and then display the updated list, but I keep getting a nullpointerexception, does anyone know where I went...
Forum: Java Jul 17th, 2008
Replies: 1
Views: 563
Posted By JConnor135
setting a string to a char

for this code I need to set string d to char c, can anyone tell me how to do it?

public static void main(String[] args)
{
int n;
int m;
String d;
char c;

Scanner sc = new...
Forum: Java Jul 17th, 2008
Replies: 3
Views: 276
Posted By JConnor135
Re: String and characters

sorry I forgot to wrap the code
Forum: Java Jul 17th, 2008
Replies: 3
Views: 276
Posted By JConnor135
String and characters

For this piece of code I have to change the arguments in the writeLine and writeBlock methods to char c, instead of String c. The problem is I dont know how to get the scanner to read in a character...
Forum: Java Jul 17th, 2008
Replies: 2
Views: 194
Posted By JConnor135
Re: help with java code

You Rock!!! Thanks!
Forum: Java Jul 17th, 2008
Replies: 2
Views: 194
Posted By JConnor135
help with java code

I have two methods that when prompted by the user will print out n amount of String on m rows, for ex: * 3 3 would print out:
***
***
***
here is the code I have:
public static void writeLine(String...
Showing results 1 to 18 of 18

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:14 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC