Manuel Prochnow

Greenhorn
since Oct 05, 2018
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
0
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by Manuel Prochnow

Hello Coder

== is not suitable for comparing string. The right way to compare two strings is the equals method.
as not s1 == s2 but s1.equals (s2).

regards kiuziu
11 months ago

Knute Snortum wrote:Yes, but your method returns true with a parameter of 1, -1, or the opposite of any prime number.

thank you for the hint.
1 year ago

Campbell Ritchie wrote:What about negative numbers, 0 and 1?

please check the wikipedia for definition

definition of prime numbers

you find prime numbers starts with 2. that the smalest prime number.
1 year ago
this is my java code for testing of the prime numbers:

It's my pleasure when you use it in your programs
1 year ago
thanks for the hint. Here is my revised contribution.

the results are:
[Mac,Linux,Window]  (the array bevor sort)
[Linux,Mac,Window]  (the array after sort)
1                             (the result of binarySearch with the correct spelling)
-2                            (the result of binarySearch with the erroneous spelling (MAc instead of Mac) )
1 year ago
import java.util.*;

public class Program
{
public static void main(String[] args) {
String[] os = new String[] {"Mac", "Linux", "Windows"};
printArray(os);
Arrays.sort(os);
printArray(os); System.out.println(Arrays.binarySearch(os,"Mac"));
}

public static void printArray(String[] a){
String result = "[";
for(int i = 0; i < a.length; i++){
result += a[i] + ",";
}
result = result.substring(0,result.length() - 2) + "]";
System.out.println(result);
}
}

Please check the code above to understand the function.
1 year ago
if you don't know what youre code do please don't code something ...

because if you code "classik" or you are code functional, when you not understand how the code works you program never run.

this is my opinion
1 year ago
look at the errror corection at lines 21, 29, 35

I think now your code run

2 years ago

Karla Carr wrote:

My other question is when I type out pw.close() then does it also imply br.close() or fr.close() has also been done? (Other questions are in comments in the code)

2 years ago
Hello ShinRyu Kazuto,

Please take a look at this code it´s more easier but dont crashed and you can read a text-file and show it (I think it ...)

2 years ago

Knute Snortum wrote:I'm not familiar with this class.  Where did you see it?  Why do you need it?

at the java code in the post at:

File Scanner with java.lang.nullpointer error?File Sanner with java.lang.nullpointer error?

there was used this module: p1utils

I  am looking for this in google search, but I found nothing matched.

Thanks for help   ;-)
2 years ago

Knute Snortum wrote:Manuel Prochnow,
Your post was moved to a new topic.
(This informational message will self destruct in two days)

I am new here. why my post was moved?
2 years ago
my post was writen foer the topic

"File Scanner with java.lang.nullpointer error?"

2 years ago

Hello

import p1utils.FileScanner;

the module is unknown to me. Where can I find this?