I’m new to Java. I want to make student information system, but whenever I used the addStudent method, I get a list with null values. This is the student class for getting names telephone numbers and student ID. This is the Node class. Methods can be wrong maybe they are too complicated sorry for that. I’m trying to learn Java.
Tag: nodes
How to create a tree by using nodes that point to next brother in Java?
I made a class (shown below) to create a tree where nodes point to the first brother on his own right and the first son (graphically the one on the extreme left). How can i generate and link nodes correctly inside a for loop? So the first iteration of the loop needs to generate and link the first son node
Transform trie class method to trie node method
my question is how to transform this method from the trie class into a method of the node class that doesn’t use the node as a parameter, I know that I have to make a first method on the tree like this: But I don’t know how to make the transformation of the method into the node class. This is
Remove an Object from an arraylist in a hashmap
I need your help, I created this two classes I need a method in Graph to delete an Arch from the ArrayList that I have in the hashmap. I tried like this in the class Graph: but when I tested it in my test main the result is that nothing changed in my ArrayList in the hashmap. someone can help
Count nodes that are bigger than all their sons
I have to make a programm that counts the nodes bigger than their sons without including the leaf nodes for example: This is my approach: But I can’t see the error Answer Assuming info is an int, this could work for you. I haven’t tested the code, so let me know if there are issues.
How can I insert an Item at the end of the List?
I am working on a project for my Data Structures class that asks me to write a class to implement a linked list of ints. Use an inner class for the Node. Include the methods below. Write a tester to enable you to test all of the methods with whatever data you want in any order. I have a method
How to synchronize method with HazelCast between two nodes?
There is Spring Boot project. Project works on two nodes. I have method for send message mail with scheduler. The message is sent 2 times, since two nodes are working. How can I use HazelCast to configure the method so that it works once, only by one, more optimal node? There is very little documentation and articles on the net.
Find if the current statement in an If/Else block is the last statement of the THEN branch
I am using JavaParser to parse through the contents of the following code and identify the sequence of statements: The code I am using to parse the above example: What I would also like to do is to identify if the current statement is an expression statement (i.e., assignment), and if yes, find if it is the last statement contained
Java – Binary Tree pointer still null after initialization?
This question is very abstract and thus very hard to describe or search for, thus why I am here. It’s a very simple question however. I have the following class: What happens if I have: Notice that child is a pointer that points to either the left or the right child of root. BUT, what happens if I instantiate the
Removing values from a custom LinkedList class
This custom class mimics the functionality of Java’s LinkedList Class except it only takes integers and obviously lacks most of the functionality. For this one method, removeAll(), I am to go through each node for the list and remove all nodes with that value. My problem is that when the first node in the list contains the value to be