Skip to content
Advertisement

java: loop with switch only works sometimes

I’m really scratching my heard on this one. I’m new at java, and I’m having the strangest thing happen. It’s homework and I’m taking it one step at a time. My issue is the loop just keeps going and stops asking for input, just keeps looping until it terminates. My comments are largely for myself. I tried to extract what

Doubly Linked List, Insert Before A Given Node in Java

The method not working: Another add method which is working: A print method to debug: DoublyLinkedList class: LinkedList and Node implementations are very straightforward. Find here: https://www.geeksforgeeks.org/doubly-linked-list/ I first create a linkedlist, insert_front() a value to make the head not null, then use the method above to insert something else. Insertion to front, end, after a node are working, however,

change binary to decimal

I have to write a method that changes binary to decimal. Write a method that will convert the supplied binary digit (as a string) to a decimal number. convertToDecimal(“01101011”) = 107 convertToDecimal(“00001011”) = 11 i have created it to change decimal to binary however im not sure how to create it binary to decimal. Answer

How to get the primary key (PK) of a record in aerospike?

I want to get a specific record from a set in aerospike. But when i execute the following query, i got no result: But when i execute the following query: It gives me all the records, but does not shows the primary key at all. { “edigest”: “BE6ZxLRMKwnbmUqPTvsmcIAgVv8=”, “set”: “prodCache”, “ttl”: 54, “gen”: 1, “bins”: { “C”: “java.util.ArrayList”, “V”: “00

Java Staircase is printing in wrong direction (hackerrank)

This solution to the staircase prints the correct output, but in the opposite direction. Any idea how to alter this solution to get the desired result? Input: Expected output: Actual Output: It’s for a hackerrank easy challenge. I just want to be able to use my approach that I discovered instead of a solution I find online. Thanks! Answer You

How to return boolean result from SQL count via JPQL

I have a simple problem with sql query. I need to get true or false, I have tried multiple methods, but without good result. This query returns 0 because I have zero records in database. Perhaps the condition should be adjusted. Thanks for all ideas. Answer Solved, thank you all.

Advertisement