CodeGym
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Help with tasks

  • Reviews
  • About us
Start
Start learning
Start learning now
  • All questions
  • anupam jha
    Level 7
    Under discussion
    declaration m a bit confused.sometimes i declare variables inside main method sometimes not.same with method...where to declare variables n methods.any rule??
    • 12/29/20
    • 532views
    • 1comment
    0
  • Vitalina
    Level 20
    Question about the task Factory method pattern
    Java Core, Level 6, Lesson 13
    Resolved
    Please gelp me! Last condition..What's wrong? I don't understand
    • 12/29/20
    • 493views
    • 2comments
    0
  • Liliane Top
    Level 24
    Amsterdam
    Question about the task Transactionality
    Java Core, Level 7, Lesson 10
    Resolved
    Why do I fail the test?Is si because I use Scanner and I should use a bufferedReader? if so why? And what is the difference between: allLines.removeAll(linesForRemoval); && linesForRemoval.clear(); ??
    • 12/29/20
    • 723views
    • 5comments
    0
  • Liliane Top
    Level 24
    Amsterdam
    Question about the task Superfluous synchronization
    Java Core, Level 7, Lesson 10
    Under discussion
    Why is he readObject() not synchronized?I thought that you have to synchronize all methods that involve fields that can be accessed by several threads at the same time. the writeObject is synchronized but the readObject is not this could cause problems as you could read the wrong value... where do I go wrong in my thinking?
    • 12/29/20
    • 809views
    • 4comments
    0
  • LennyMan
    Level 25
    Lucca
    Question about the task File in a static block
    Java Core, Level 5, Lesson 12
    Resolved
    My version should be correctIts working but not validate, i seen the solution and its quite different from mine,but the output should be the same. im just wondering if my version it's legal and correct even if its not validate. Please let me know if there are some important mistake.
    • 12/29/20
    • 508views
    • 2comments
    0
  • Justin Johnson
    Level 31
    Clearwater
    Question about the task Restaurant (part 22)
    Java Multithreading, Level 9, Lesson 15
    Under discussion
    timing out....please helpcant get it to validate
    • 12/18/20
    • 745views
    • 2comments
    0
  • Vo
    Level 41
    Sofia
    Question about the task Adding a file to an archive
    Java Collections, Level 1, Lesson 6
    Resolved
    Why is my zip file getting corrupted?Even if I exclude the part in which I add files to the new created zip, it gets corrupted. Upon opening the archive I get "Error occurred" message. package com.codegym.task.task31.task3105; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOExc
    • 12/29/20
    • 865views
    • 1comment
    0
  • Marvin Ellis
    Level 7
    Peoria
    Question about the task Playing Javarella
    Java Syntax, Level 7, Lesson 9
    Resolved
    Array IssueI think I have the premise down correctly. I am sorting the 3 list inside of 1 for loop but I am getting array index and range errors. Why is that?
    • 12/28/20
    • 530views
    • 2comments
    0
  • Josephine
    Level 1
    Normal
    Question about the task Replacing numbers
    Java Core, Level 9, Lesson 11
    Archived
    My code works perfectly in InteliJ.why it is not passing.Someone helpMy code works perfectly in InteliJ.Someone please help
    • 12/24/20
    • 529views
    • 3comments
    0
  • Liliane Top
    Level 24
    Amsterdam
    Question about the task CRUD 2
    Java Core, Level 7, Lesson 10
    Resolved
    The allPeople list is volatile what does the synchronized(allPeople) add to this?in the code we have: public static volatile List allPeople = new ArrayList<>(); and we have to add synchronized(allPeople) to the each case: case "-c": synchronized (allPeople) { for (int i = 1; i < args.length; i = i + 3) { creat
    • 12/28/20
    • 437views
    • 2comments
    0
  • Rich
    Level 23
    San Diego
    Question about the task OOP: Fix inheritance problems
    Java Core, Level 5, Lesson 2
    Under discussion
    last requirementAll fingers come up as artificial for some reason. little hint pls...
    • 12/27/20
    • 442views
    • 1comment
    0
  • Anitamalina
    Level 18
    København
    Question about the task Going national
    Java Syntax, Level 8, Lesson 11
    Under discussion
    My code works, but I can't passI don't understand why this isn't working?
    • 12/27/20
    • 576views
    • 1comment
    0
  • Liliane Top
    Level 24
    Amsterdam
    Question about the task The early bird gets the worm
    Java Core, Level 6, Lesson 13
    Resolved
    What is wrong with my code?Why is it not stop running? I do not understand . I s read a line from the console and add it to the list. I increment the readStringCount It should stop running as readStringcount is no longer smaller than count However it just keeps running why?
    • 12/26/20
    • 1305views
    • 27comments
    0
  • Anitamalina
    Level 18
    København
    Question about the task Make a family
    Java Syntax, Level 8, Lesson 11
    Under discussion
    NullPointerException in line 67Hi, I don't understand why I get a null pointer exception in line 67, and what's wrong with my code? Can someone help me, thank you :-)
    • 12/28/20
    • 825views
    • 1comment
    0
  • slyyx
    Level 15
    New York City
    Question about the task Snake (Part 18/20)
    Games, Level 0, Lesson 1
    Under discussion
    I can't tell if I'm misunderstanding the directionsI can't tell if I'm misunderstanding the directions or am just going about the problem the right way
    • 12/12/20
    • 741views
    • 4comments
    2
  • Liliane Top
    Level 24
    Amsterdam
    Question about the task CRUD
    Java Core, Level 7, Lesson 10
    Resolved
    This is a real puzzleI do not know why I fail the test. The output is correct just not very clean code but it does work. So how to go from here?
    • 12/27/20
    • 648views
    • 9comments
    0
  • Marvin Ellis
    Level 7
    Peoria
    Question about the task String array in reverse order
    Java Syntax, Level 7, Lesson 4
    Resolved
    Array Out of Bound IndexWhat is causing this excpetion
    • 10/22/20
    • 834views
    • 2comments
    0
  • Marvin Ellis
    Level 7
    Peoria
    Question about the task To the top of the list
    Java Syntax, Level 7, Lesson 6
    Resolved
    The program should add lines to the beginning of the list.Should I change the for loop to start from10 and go to 0? I am not sure why it stating the last two are wrong?
    • 10/22/20
    • 914views
    • 1comment
    0
  • Rich
    Level 23
    San Diego
    Question about the task The simplest code: part 2
    Java Core, Level 5, Lesson 6
    Under discussion
    little hintit refuses to pass with an empty constructor. just need a hint
    • 12/27/20
    • 570views
    • 1comment
    0
  • Tina
    Level 17
    Saint Petersburg
    Question about the task The simplest code: part 2
    Java Core, Level 5, Lesson 6
    Under discussion
    Why it does not pass the test. Why it does not pass the test.
    • 6/10/19
    • 1937views
    • 7comments
    0
  • Abhishek Rangari
    Level 22
    Nagpur
    Question about the task OOP: Method overloading
    Java Core, Level 5, Lesson 4
    Under discussion
    Can anyone help me in this quest?Not sure what is going wrong ..
    • 12/3/18
    • 1986views
    • 2comments
    0
  • The Chief
    Level 18
    Question about the task Census
    Java Syntax, Level 8, Lesson 8
    Under discussion
    Why doesn't this task need a HashMap copy?Why don't the middle two methods require a copy of the HashMap such as: HashMap copy = new HashMap(map); like similar tasks on this lesson do?
    • 12/24/20
    • 506views
    • 5comments
    0
  • anupam jha
    Level 7
    Under discussion
    staticwhy do we need static class ?? whats the reason...
    • 12/26/20
    • 537views
    • 1comment
    0
  • Laura
    Level 7
    Lübeck
    Question about the task Cat and statics
    Java Syntax, Level 6, Lesson 11
    Under discussion
    Code mistakeAlthough I compared my code to others, I have a problem with the static variable says the compiler Idk I can't find my mistake. Can anyone help me? Thank u.
    • 10/4/20
    • 658views
    • 2comments
    1
  • George
    Level 15
    Question about the task Minesweeper (Part 6/16)
    Games, Level 0, Lesson 0
    Resolved
    Counting mines for a cell that is a mine?This is failing requirement 3 saying that I'm counting mines for a cell that is mine. I believe I skip those with continue command. Any ideas? It's also failing the 4th requirement. Says that countMineNeighbors() isn't using getNeighbors(GameObject) which I am using but obviously I'm missing someth
    • 9/17/20
    • 925views
    • 2comments
    2
  • hidden #10444738
    Level 16
    Question about the task Exception when working with numbers
    Java Syntax, Level 9, Lesson 6
    Under discussion
    printStackTrace?Wouldn't printStackTrace be better, it shows also the line number and the error. Just by using catch Execption errror
    • 7/28/19
    • 1936views
    • 2comments
    0
  • Jen P
    Level 26
    Question about the task Reading from a stream
    Java Collections, Level 2, Lesson 4
    Under discussion
    "Under no circumstances should null be returned" error forever, even passed local unit test.Hi Guys, I , again sadly, met the same "Under no circumstances should null be returned." error in this problem. I have no idea on why this error constantly throws out. Any advice ?! Thank you! public class Solution { public static void main(String[] args) throws IOException { StringWri
    • 8/24/19
    • 1385views
    • 7comments
    0
  • Liliane Top
    Level 24
    Amsterdam
    Question about the task Shall we play?
    Java Core, Level 6, Lesson 13
    Resolved
    Why do I fail the test?The output seems correct but I fail the test with 2 errors 1) The run method does not display the required text. 2) If a player wins, his or her run method should display [getName() + ":won!"]. For example: [Jones:won!]. but my output is: Gates:Start Game Smith:Start Game Gates:Gather resources Gat
    • 12/24/20
    • 760views
    • 4comments
    0
  • null
    Level 26
    Orlando
    Question about the task In the blue depths of the stack trace…
    Java Syntax, Level 9, Lesson 2
    Under discussion
    Can anyone explain why i use: stackTraceElement elements.length will return its length but not elements.length() as a method..
    • 2/20/20
    • 1035views
    • 3comments
    0
  • Lorraine Brown
    Level 2
    Oakland
    Question about the task No comments needed
    Java Syntax, Level 0, Lesson 8
    Under discussion
    I do not not understand the answer in hint.I downloaded intellij IDEA. I ran it and see the answer. Can you explain it in email to me mrsbrown08837@gmail.com? I went to https://www.w3schools.com/java/java_operators.asp to verify how the operators should work.
    • 9/30/20
    • 795views
    • 1comment
    0
  • 1
  • ...
  • 108
  • 109
  • 110
  • 111
  • 112
  • ...
  • 374
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym