How to give return type to jawa program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to give return type to jawa program?

7th Oct 2018, 10:34 AM
pubudi kaushalya
2 Answers
+ 1
return type of a function in Java: boolean isPrime(x){ for(int i=1;i<x;i++){ if(x % i == 0){ return false; } } return true; } return types are: boolean (true/false) int (Integer; .., -1, 0, 1, 2, ...) double (.., -1.0, -1.0...1, 0.0, ... 1,01) ...
13th Oct 2018, 1:56 PM
Anton Böhler
Anton Böhler - avatar
+ 1
they are writen istead of void. void means nothing is returned
13th Oct 2018, 1:56 PM
Anton Böhler
Anton Böhler - avatar