Questions tagged [java]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Need help printing out values correctly without repeating them in java

I have a program where a user enters the size of the card set from 1 to 52 and the x amount cards need to be printed when printSet() is called. After that bubbleSort() is called to sort the values and ...
0
votes
1answer
18 views

How to solve no suitable constructor found for Class1(Class2)?

So there is a assignment where my prof has written code like the following below: Employee emp1 = new Employee(new Name("FirstName",'M', "LastName")); and I get an error: no ...
0
votes
0answers
5 views

How to keep track of multiple arrays in java for a card game?

So there is a java program game where I need to print the values (2-14) and suits (Hearts, Clubs, Diamonds, Spades) but can't think really think of how to do it.
0
votes
1answer
34 views

How to solve incompatible types: Name cannot be converted to String in java?

so I have declared a variable called name private Name name; and am trying to using like the following below: public String getName(){ return name; } void setName(String aName){ this.name = ...
0
votes
0answers
11 views

What does a var : Var mean in a UML diagram?

So I have an assignment where I have to write Java code from a UML diagram and am not able to understand a part from the UML diagram. what does - name : Name and - startDate : Date mean? And what ...
0
votes
1answer
13 views

What does Random rand.nextInt(x)+y actually do?

So I know that the following code below would give me numbers between 0-9 Random rand = new Random(); int secret = rand.nextInt(10); But why does the following code give me numbers out of range: ...
0
votes
1answer
20 views

Why do I get a weird result when I am adding a number, string and then number again in java?

So I have the following line: System.out.println(1 + 2 + " is " + 1 + 2); and the following output is the following: 3 is 12 But I cannot understand why that is
0
votes
0answers
35 views

SharedPreferences not working in Pokedex app android

I have tried many ways to get this to work, but only this last part is not working. I have tried using different variables. The Saving State is not working at all. Any help would be really appreciated....
0
votes
0answers
56 views

Android Recycler View

I am doing the Android track, specifically the Pokedex assignment. My code is running but the list of Pokemon is not displaying when I open the application. The filtering does work when I use the ...
0
votes
1answer
157 views

what is wrong with scanf in the program written bellow, Why it is not asking for value when input is not an integer?

#include<stdio.h> #include<stdlib.h> //#include<cs50.h> int main(void){ int minutes; printf("minutes:"); int c=scanf("%d",&minutes);//if input here is character then second ...
0
votes
1answer
327 views

Getting only routes of a specific clicked marker to show on a map

I'm totally new to this and taking a Java course. There're airport markers displayed on a map then there're routes from every airport to all possible destinations. I want to make a method that when a ...