# System.out.print() not working

**URL:** <https://forum.codewithmosh.com/t/system-out-print-not-working/456>\
**Category:** Java\
**Created:** [November 3, 2020, 1:20am UTC](https://forum.codewithmosh.com/t/system-out-print-not-working/456 "2020-11-03T01:20:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrsevans](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jrsevans](https://forum.codewithmosh.com/u/jrsevans)\
**Post date:** [November 3, 2020, 1:20am UTC](https://forum.codewithmosh.com/t/system-out-print-not-working/456/1 "2020-11-03T01:20:41Z")

</div>

When I use System.out.print() the console doesn’t show anything, it only works if I put System.out.println() . Is there something I’m doing wrong?

```
import java.util.Scanner;

public class Calculator {
    
    public static void main(String[] args) {
    
        Scanner scanner = new Scanner(System.in);

        System.out.print("Principal : ");
        int principal = scanner.nextInt();
       
        System.out.print("Annual Interest Rate: ");
        float aInterestR = scanner.nextFloat();
        
        System.out.print("Period (Years): ");
        byte period = scanner.nextByte();
        
        double mortgage = principal * ((aInterestR*(1+aInterestR) * period)/(1+aInterestR)* period-1);
        

    
    
    }
    
    
    
}
```

---

<div class="post-metadata">

**Author:** ![nekoiry](https://avatars.discourse-cdn.com/v4/letter/n/d26b3c/32.png) [@nekoiry](https://forum.codewithmosh.com/u/nekoiry)\
**Post date:** [November 9, 2020, 2:53am UTC](https://forum.codewithmosh.com/t/system-out-print-not-working/456/2 "2020-11-09T02:53:27Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/588bf7ec6e1c7e7e1bfe3dbf0aef6b3684a8b9ed.png)

The program worked well on my machine. However, in your code, the final mortgate didn’t show. You should print it.

And a quick reminder, you should use an “int” or “long” to store any non-technical integer value and “double” for any non-technical decimal value, even it is far less likely to exceed the limit. Bytes, Shorts, Floats are built for talking to your hardware.

---

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [November 9, 2020, 8:10am UTC](https://forum.codewithmosh.com/t/system-out-print-not-working/456/3 "2020-11-09T08:10:04Z")

</div>

Hi,  
Yes you didn’t calculate the **period** and your mortgage formula is not correct.  
Watch the solution or download the source file to see the code mosh used to calculate the mortgage

---

<div class="post-metadata">

**Author:** ![coreycollinsm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/coreycollinsm/32/397_2.png) [@coreycollinsm](https://forum.codewithmosh.com/u/coreycollinsm)\
**Post date:** [December 11, 2020, 7:54pm UTC](https://forum.codewithmosh.com/t/system-out-print-not-working/456/4 "2020-12-11T19:54:19Z")

</div>

That looks like a glitch that I had with IntelliJ  
Are you using IntelliJ?  
Have you restarted the program?

When I had this issue, it would not use print(), but would use println().  
It also wouldn’t print Strings \> it would only print the reference to the memory.  
Mine required a restart and resolved both issues.
