# Java

**URL:** https://forum.codewithmosh.com/c/java/7.md?page=2

[Latest](https://forum.codewithmosh.com/latest.md) · [Categories](https://forum.codewithmosh.com/categories.md)

**Page:** 3

---

## [Java 3-\>Collections-\>Iterator. What was the point of passing GenericList to Iterator inner class?](https://forum.codewithmosh.com/t/java-3-collections-iterator-what-was-the-point-of-passing-genericlist-to-iterator-inner-class/23355)

<div class="topic-metadata">

**Author:** [@pk4](https://forum.codewithmosh.com/u/pk4)\
**Replies:** 1\
**Last updated:** [January 2, 2024, 4:28am UTC](https://forum.codewithmosh.com/t/java-3-collections-iterator-what-was-the-point-of-passing-genericlist-to-iterator-inner-class/23355 "2024-01-02T04:28:40Z")

</div>

I have one question(correction?) regarding Java advanced lesson . Ultimate Java Part 3: Advanced Topics-\>Collections-\>5. The iterator interface. I wonder, why did we need to pass a copy of the reference to GenericList ob…

---

## [Java Video Source Code](https://forum.codewithmosh.com/t/java-video-source-code/24323)

<div class="topic-metadata">

**Author:** [@dmoncur1748](https://forum.codewithmosh.com/u/dmoncur1748)\
**Replies:** 4\
**Last updated:** [December 30, 2023, 7:57pm UTC](https://forum.codewithmosh.com/t/java-video-source-code/24323 "2023-12-30T19:57:53Z")

</div>

Can’t locate the source code for the video project, or any of the courses for that matter. Where do I go to download the source code.

---

## [Java Related Jobs](https://forum.codewithmosh.com/t/java-related-jobs/18455)

<div class="topic-metadata">

**Author:** [@Oriol](https://forum.codewithmosh.com/u/Oriol)\
**Replies:** 4\
**Last updated:** [December 20, 2023, 8:45am UTC](https://forum.codewithmosh.com/t/java-related-jobs/18455 "2023-12-20T08:45:46Z")

</div>

I’m finishing the Java Course and I was wondering if someone knows of a way to get a job related to Java or programming in general. I don’t really care about the money, I mean, if I can get it, I have no issues, of cour…

---

## [How much time in days to complete it?](https://forum.codewithmosh.com/t/how-much-time-in-days-to-complete-it/24077)

<div class="topic-metadata">

**Author:** [@Feysel](https://forum.codewithmosh.com/u/Feysel)\
**Replies:** 4\
**Last updated:** [December 12, 2023, 11:11am UTC](https://forum.codewithmosh.com/t/how-much-time-in-days-to-complete-it/24077 "2023-12-12T11:11:54Z")

</div>

Hello, I am 4th year Electrical and computer engineering student. I am planning to take the Ultimate Java Part 1 to Part 3. I want to approximate the time to complete it. So if anyone who took the course can share his ex…

---

## [Adding Java GUI](https://forum.codewithmosh.com/t/adding-java-gui/15867)

<div class="topic-metadata">

**Author:** [@dansatch](https://forum.codewithmosh.com/u/dansatch)\
**Replies:** 6\
**Last updated:** [November 29, 2023, 10:48am UTC](https://forum.codewithmosh.com/t/adding-java-gui/15867 "2023-11-29T10:48:21Z")

</div>

Recently completed the ultimate Java series. Now i want to learn how to implement GUI in Java. Heard about Swing, AWT and others. Please could anyone guide me on which is best to learn? Regarding the learning aspect, Mo…

---

## [Mortgage Calculator](https://forum.codewithmosh.com/t/mortgage-calculator/4687)

<div class="topic-metadata">

**Author:** [@Coderno.30000](https://forum.codewithmosh.com/u/Coderno.30000)\
**Replies:** 17\
**Last updated:** [November 26, 2023, 10:44pm UTC](https://forum.codewithmosh.com/t/mortgage-calculator/4687 "2023-11-26T22:44:25Z")

</div>

will u please put the whole Javascript of the mortgage calculator here I know its in the video but still My reason:- when I put “/” at the ending it says its the illegal start of expression sry if this is silly

---

## [Java Streams .skip() and .limit() errors](https://forum.codewithmosh.com/t/java-streams-skip-and-limit-errors/23815)

<div class="topic-metadata">

**Author:** [@King\_Sardius](https://forum.codewithmosh.com/u/King_Sardius)\
**Replies:** 1\
**Last updated:** [November 24, 2023, 9:24am UTC](https://forum.codewithmosh.com/t/java-streams-skip-and-limit-errors/23815 "2023-11-24T09:24:58Z")

</div>

Ultimate Java Part 3: Advance Topics → Streams → Sorting Streams video. movies.stream().skip(10).limit(15).forEach(movie -\> System.out.println(movie)); movies.stream().limit(15).skip(5).forEach(movie -\> System.out.print…

---

## [Generic Type Method Syntax Error](https://forum.codewithmosh.com/t/generic-type-method-syntax-error/23777)

<div class="topic-metadata">

**Author:** [@King\_Sardius](https://forum.codewithmosh.com/u/King_Sardius)\
**Replies:** 1\
**Last updated:** [November 21, 2023, 8:14am UTC](https://forum.codewithmosh.com/t/generic-type-method-syntax-error/23777 "2023-11-21T08:14:43Z")

</div>

Greetings. In the Ultimate Java Part 3: Advance Topics module → Generics section → Generic Methods video, Mosh Explains the syntax for a generic method in a non-generic class. IntelliJ IDE is interpreting the return ty…

---

## [Var key word in java not working](https://forum.codewithmosh.com/t/var-key-word-in-java-not-working/21597)

<div class="topic-metadata">

**Author:** [@Type\_666\_for\_help](https://forum.codewithmosh.com/u/Type_666_for_help)\
**Replies:** 10\
**Last updated:** [November 21, 2023, 1:33am UTC](https://forum.codewithmosh.com/t/var-key-word-in-java-not-working/21597 "2023-11-21T01:33:11Z")

</div>

I’m in the classes section of the intermediate level of the Ultimate Java course and for some reason when I type in the code the same way that it comes up in the tutorial the compiler gives me an error at the var keyword…

---

## [How do I get Java generator on IntelliJ instead of Java FX?](https://forum.codewithmosh.com/t/how-do-i-get-java-generator-on-intellij-instead-of-java-fx/23088)

<div class="topic-metadata">

**Author:** [@Subin](https://forum.codewithmosh.com/u/Subin)\
**Replies:** 2\
**Last updated:** [November 21, 2023, 2:20am UTC](https://forum.codewithmosh.com/t/how-do-i-get-java-generator-on-intellij-instead-of-java-fx/23088 "2023-11-21T02:20:44Z")

</div>

Hello guys, I recently started Mosh’s “The Ultimate Java Mastery Series” but found that this course is run with Java version 12.0.1 and IntelliJ 2019.1.2 However, since it is already 2023 I could not find the same ve…

---

## [Starting java. current version looks different to mosh's tutorial](https://forum.codewithmosh.com/t/starting-java-current-version-looks-different-to-moshs-tutorial/21927)

<div class="topic-metadata">

**Author:** [@calvinss](https://forum.codewithmosh.com/u/calvinss)\
**Replies:** 5\
**Last updated:** [November 21, 2023, 2:19am UTC](https://forum.codewithmosh.com/t/starting-java-current-version-looks-different-to-moshs-tutorial/21927 "2023-11-21T02:19:49Z")

</div>

Hello, I have recently started learning java with mosh. My intellij looks a bit different from mosh’s video. My JDK is also 20 as it is the recent one but in mosh’s video it is 12. I understand that the tutorial may b…

---

## [Java course issues](https://forum.codewithmosh.com/t/java-course-issues/16583)

<div class="topic-metadata">

**Author:** [@zodegis](https://forum.codewithmosh.com/u/zodegis)\
**Replies:** 7\
**Last updated:** [November 21, 2023, 2:19am UTC](https://forum.codewithmosh.com/t/java-course-issues/16583 "2023-11-21T02:19:02Z")

</div>

So I started the video course today and found that the instructions to use “JDK version 12” are no longer valid. Also a lot of the code that is used in some of the early lessons throws errors. Since I paid for these cou…

---

## [Beginning Java Troubles](https://forum.codewithmosh.com/t/beginning-java-troubles/16388)

<div class="topic-metadata">

**Author:** [@Jmtaylor93](https://forum.codewithmosh.com/u/Jmtaylor93)\
**Replies:** 5\
**Last updated:** [November 21, 2023, 2:18am UTC](https://forum.codewithmosh.com/t/beginning-java-troubles/16388 "2023-11-21T02:18:43Z")

</div>

Hey, Why am I only able to program under Java FX and not Java like at the beginning of the course? Im on windows.

---

## [JUnit testing with Mock](https://forum.codewithmosh.com/t/junit-testing-with-mock/22298)

<div class="topic-metadata">

**Author:** [@CaptnPaul](https://forum.codewithmosh.com/u/CaptnPaul)\
**Replies:** 1\
**Last updated:** [November 21, 2023, 1:48am UTC](https://forum.codewithmosh.com/t/junit-testing-with-mock/22298 "2023-11-21T01:48:24Z")

</div>

I need a GOOD mocking resource. I can not use Mockito. Powermock and Easy Mock are available. Specifically, I need to mock a java method which has 3 parameters, one of which is a List object. If you know of such a r…

---

## [Stacks Syntax Error](https://forum.codewithmosh.com/t/stacks-syntax-error/22460)

<div class="topic-metadata">

**Author:** [@klr536s](https://forum.codewithmosh.com/u/klr536s)\
**Replies:** 4\
**Last updated:** [November 21, 2023, 1:46am UTC](https://forum.codewithmosh.com/t/stacks-syntax-error/22460 "2023-11-21T01:46:09Z")

</div>

I am currently learning about stacks and I keep getting a SyntaxError: for class What am I doing wrong?

---

## [Does mosh have a course teaching java unit testing?](https://forum.codewithmosh.com/t/does-mosh-have-a-course-teaching-java-unit-testing/23712)

<div class="topic-metadata">

**Author:** [@Arthur](https://forum.codewithmosh.com/u/Arthur)\
**Replies:** 2\
**Last updated:** [November 19, 2023, 9:48pm UTC](https://forum.codewithmosh.com/t/does-mosh-have-a-course-teaching-java-unit-testing/23712 "2023-11-19T21:48:12Z")

</div>

Does mosh have a course teaching java unit testing?

---

## [Question about the formula Mosh used](https://forum.codewithmosh.com/t/question-about-the-formula-mosh-used/21787)

<div class="topic-metadata">

**Author:** [@Conan\_7x](https://forum.codewithmosh.com/u/Conan_7x)\
**Replies:** 2\
**Last updated:** [August 22, 2023, 1:00am UTC](https://forum.codewithmosh.com/t/question-about-the-formula-mosh-used/21787 "2023-08-22T01:00:55Z")

</div>

In ‘Java Part 1’ in the ‘clean code’ section ep 7 minute (1:10), he used a formula to calculate the remaining balance. Can’t we subtract the payment from the principal directly in a for loop? Like why we need a formula ? …

---

## [Access Modifiers in Java](https://forum.codewithmosh.com/t/access-modifiers-in-java/21707)

<div class="topic-metadata">

**Author:** [@DumbledoresAmy](https://forum.codewithmosh.com/u/DumbledoresAmy)\
**Replies:** 2\
**Last updated:** [July 26, 2023, 4:53pm UTC](https://forum.codewithmosh.com/t/access-modifiers-in-java/21707 "2023-07-26T16:53:44Z")

</div>

Is it accurate to compare access modifiers to the concepts of scoping and hoisting in JavaScript?

---

## [Running Code Outside of Main](https://forum.codewithmosh.com/t/running-code-outside-of-main/21670)

<div class="topic-metadata">

**Author:** [@DumbledoresAmy](https://forum.codewithmosh.com/u/DumbledoresAmy)\
**Replies:** 3\
**Last updated:** [July 25, 2023, 12:08pm UTC](https://forum.codewithmosh.com/t/running-code-outside-of-main/21670 "2023-07-25T12:08:57Z")

</div>

I notice that Mosh often runs code in a class other than Main. I haven’t figured out how to do this. I’ve been adding the class from the lesson to Main and running from there. Is anyone able to explain how to run the fro…

---

## [How to get java complete bundle certificate](https://forum.codewithmosh.com/t/how-to-get-java-complete-bundle-certificate/21562)

<div class="topic-metadata">

**Author:** [@Medomaher](https://forum.codewithmosh.com/u/Medomaher)\
**Replies:** 0\
**Last updated:** [July 17, 2023, 4:02pm UTC](https://forum.codewithmosh.com/t/how-to-get-java-complete-bundle-certificate/21562 "2023-07-17T16:02:07Z")

</div>

I had finished the first two courses for java bundle ( java basics + java OOP ) how can I get a certificate for these two courses or should I finish the whole bundle to get it ? and if so where can I

---

## [Can anyone Help me in understanding the below code snippet related to Java Stream?](https://forum.codewithmosh.com/t/can-anyone-help-me-in-understanding-the-below-code-snippet-related-to-java-stream/21510)

<div class="topic-metadata">

**Author:** [@Sanket007](https://forum.codewithmosh.com/u/Sanket007)\
**Replies:** 0\
**Last updated:** [July 15, 2023, 6:32am UTC](https://forum.codewithmosh.com/t/can-anyone-help-me-in-understanding-the-below-code-snippet-related-to-java-stream/21510 "2023-07-15T06:32:52Z")

</div>

public static IntStream primes(int max){ IntStream primes = IntStream.range(2, max); IntFunction\<IntPredicate\> sieve = n-\>i-\>i==n || i % n != 0; primes = primes.filter(sieve.apply(2)); …

---

## [Need Help, Hey Mosh if you read it please help me](https://forum.codewithmosh.com/t/need-help-hey-mosh-if-you-read-it-please-help-me/21383)

<div class="topic-metadata">

**Author:** [@Azan](https://forum.codewithmosh.com/u/Azan)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 2:59pm UTC](https://forum.codewithmosh.com/t/need-help-hey-mosh-if-you-read-it-please-help-me/21383 "2023-07-10T14:59:26Z")

</div>

Hello everyone I need your little help, I really want to learn java, I have watched many other courses of java on YouTube but am not able to understand them and feels like java is very complicated and i will not learn it…

---

## [Is Java12 still good for learning Java in 2023?](https://forum.codewithmosh.com/t/is-java12-still-good-for-learning-java-in-2023/20887)

<div class="topic-metadata">

**Author:** [@rezadb](https://forum.codewithmosh.com/u/rezadb)\
**Replies:** 2\
**Last updated:** [June 21, 2023, 3:28am UTC](https://forum.codewithmosh.com/t/is-java12-still-good-for-learning-java-in-2023/20887 "2023-06-21T03:28:07Z")

</div>

How problematic can it be to learn Java with the old version? The course is based on Java 12 and now the latest version is Java 20.

---

## [Problem with java certificate](https://forum.codewithmosh.com/t/problem-with-java-certificate/20948)

<div class="topic-metadata">

**Author:** [@Bigbrainsjose](https://forum.codewithmosh.com/u/Bigbrainsjose)\
**Replies:** 1\
**Last updated:** [June 20, 2023, 5:58pm UTC](https://forum.codewithmosh.com/t/problem-with-java-certificate/20948 "2023-06-20T17:58:05Z")

</div>

Please how can i get my certificate after completing the java course.

---

## [Need extra help for java programing](https://forum.codewithmosh.com/t/need-extra-help-for-java-programing/20728)

<div class="topic-metadata">

**Author:** [@BUSBEE](https://forum.codewithmosh.com/u/BUSBEE)\
**Replies:** 2\
**Last updated:** [June 16, 2023, 9:55am UTC](https://forum.codewithmosh.com/t/need-extra-help-for-java-programing/20728 "2023-06-16T09:55:25Z")

</div>

Hi, I have just starting to learn “programing in jave”. I am using INTELLJ IDIA IntelliJ IDEA 2023.1.2 (Community Edition) e version: 17.0.6+10-b829.9 amd64 . I need extra help to start my first program. I have created…

---

## [Ultimate Java Part 2 code not runnable](https://forum.codewithmosh.com/t/ultimate-java-part-2-code-not-runnable/15186)

<div class="topic-metadata">

**Author:** [@alacrity](https://forum.codewithmosh.com/u/alacrity)\
**Replies:** 13\
**Last updated:** [May 29, 2023, 6:35pm UTC](https://forum.codewithmosh.com/t/ultimate-java-part-2-code-not-runnable/15186 "2023-05-29T18:35:27Z")

</div>

I downloaded the code for the Mortgage Calculator for part 2 but when I attempt to run the main.java I get an error “The file in the editor is not runnable.” There run arrow is grey.

---

## [Package trouble with Mortgage Calculator refactoring](https://forum.codewithmosh.com/t/package-trouble-with-mortgage-calculator-refactoring/19770)

<div class="topic-metadata">

**Author:** [@C-S](https://forum.codewithmosh.com/u/C-S)\
**Replies:** 4\
**Last updated:** [May 13, 2023, 1:47pm UTC](https://forum.codewithmosh.com/t/package-trouble-with-mortgage-calculator-refactoring/19770 "2023-05-13T13:47:24Z")

</div>

Hi everyone! I’m new to the course and am currently at Lesson 4 (Extracting the Console Class) of “Refactoring Towards an Object-oriented Design” in Ultimate Java Part 2 (Object-oriented Programming). I’m trying to work …

---

## [Mortgage Calculator Variable](https://forum.codewithmosh.com/t/mortgage-calculator-variable/15768)

<div class="topic-metadata">

**Author:** [@Oriol](https://forum.codewithmosh.com/u/Oriol)\
**Replies:** 5\
**Last updated:** [May 12, 2023, 9:55am UTC](https://forum.codewithmosh.com/t/mortgage-calculator-variable/15768 "2023-05-12T09:55:05Z")

</div>

Hey there! I was doing the Mortgage Calculator as in the java courses with Mosh are explained. However, I didn’t quite get one part. Where’s the numberOfPaymentsMade variable specified? I’ve been trying to figure that o…

---

## [Java course price](https://forum.codewithmosh.com/t/java-course-price/20185)

<div class="topic-metadata">

**Author:** [@aymen\_toukebri](https://forum.codewithmosh.com/u/aymen_toukebri)\
**Replies:** 0\
**Last updated:** [May 11, 2023, 11:42am UTC](https://forum.codewithmosh.com/t/java-course-price/20185 "2023-05-11T11:42:22Z")

</div>

I hope this message finds you well. I recently came across your course offering and was excited to see that the price was listed as $10. However, upon further inspection, it appears that the course price is invalid and i…

---

## [Abstraction vs abstract class/interfaces](https://forum.codewithmosh.com/t/abstraction-vs-abstract-class-interfaces/20068)

<div class="topic-metadata">

**Author:** [@sara](https://forum.codewithmosh.com/u/sara)\
**Replies:** 5\
**Last updated:** [May 10, 2023, 1:36am UTC](https://forum.codewithmosh.com/t/abstraction-vs-abstract-class-interfaces/20068 "2023-05-10T01:36:15Z")

</div>

In this java tutorial under the abstraction we are taught to hide the implementation details and make our code less coupled. But on this video we are not taught about abstract classes. Isn’t abstract classes not related …

[Previous page](https://forum.codewithmosh.com/c/java/7.md?page=1)

[Next page](https://forum.codewithmosh.com/c/java/7.md?page=3)
