<commit_before>﻿# How To Post Questions

This is the text version of the rules. The official rules are in list form:  
[./Rules.md](./Rules.md "Official Rules")

The idea of this text is that you do not have to read a list and also get some more advice on how to write good questions and answers. The list has two other advantages: It is directly on facebook (in our group) and it is a list so we can reference the number of a rule.

# Moderation

All posts are reviewed before they appear in the group to be answered. Requests for membership are moderated too.

# Allowed Topics

Posts must be about Java, C, C++, C#, Android, PHP, Computer Science and so on. Always state in your post what topic it is about.

No contest questions, no adverts, no job adverts, no spam, no religious, political, nationalistic, sexist, homophobic, and so on.  
There are other groups for job adverts. Posting them in our group will lead to a permanent ban.

# Language / Code

Posts in standard English only. No slang, txtspk or l33tsp33k.  
It doesn’t have to be perfect English, but at least use complete words and sentences. English is by far the most important Language for you as a computer scientist. Learn it!

Source code should not be directly in the text (unless it’s just two or three lines). Use any of the following sites to paste your code and post a link to it.

*   [https://pastebin.com/](https://pastebin.com/ "pastebin")
*   [https://gist.github.com/](https://gist.github.com/ "gist")
*   [https://www.codepad.org/](https://www.codepad.org/%20  "codepad")
*   [http://pastie.org/](http://pastie.org/ "pastie")

Full Tutorial: [How to paste Source Code](http://java-queries.rhcloud.com/how-to-paste-source-code/ "How to paste Source Code")

# Example

If your question looks like this it will probably be approved:

* * *

> **<NAME>:** [Java/OOP:] I have 3 Java classes: [http://pastebin.com/qQ3Wpkkr](http://pastebin.com/qQ3Wpkkr)  
> I create an object like so:  
> Teacher t = new Teacher(“001”, “<NAME>”)  
> Then I want to see the “info” like this:  
> System.out.println(t.getInfo());  
> I get “I’m a Teacher. My ID is null and my name is null”.  
> But I expected “I’m a Teacher. My ID is 001 and my name is <NAME>”  
> Where is my mistake? Note that I did use final keyword. Why are both null, even though I never assign null to those fields?

* * *

It is good because:

*   It starts with the topic (in this case: Java and OOP).
*   All code is linked on pastebin.
*   It explains what has been tried out.
*   It tells the actual and the expected output.
*   It describes what has already been tried out (using final keyword).

# How to ask good questions

If you are a raw novice, don’t be afraid to ask – there are no stupid questions.

**State your goal!** That is the most important information to answer your question. This text explains how to ask questions the smart way:  
[http://www.catb.org/esr/faqs/smart-questions.html](http://www.catb.org/esr/faqs/smart-questions.html "How To Ask Questions The Smart Way")

Try to provide a _short, self contained, correct example_: [http://sscce.org/](http://sscce.org/ "The SSCCE")

Tell us what result/output you expect. The compiler and the runtime rarely do anything wrong, so don’t claim the output is _wrong_. It isn’t – your code is.

Before you ask, **use Google** and read your Java **textbook**, and the [Java API specs](http://docs.oracle.com/javase/8/docs/api/ "Java™ Platform, Standard Edition 8 API Specification"). There’s no point in asking something that can be answered by a quick google search.

If you are looking for a book or software then check our [top recommended java books](http://java-queries.rhcloud.com/top-recommended-java-books/ "Top Recommended Java Books") instead of opening a new thread.

Start your post with the topic (e.g. OOP, Android, Networking).  
[Don’t start with “Can I …”. If you could, you wouldn’t have to ask.](http://java-queries.rhcloud.com/can-i/ "Can I …?")  
[Don’t start with “How can I …”. There are a million ways, we can’t list all.](http://java-queries.rhcloud.com/how-can-i/ "How can I … ?") Instead, state how you want to do it.  
Don’t start with “Is is possible …” – it is in most cases.  
Generally don’t ask anything that can be answered by:  

> **“Yes, by writing the appropriate code.”**<commit_msg>links fixed<commit_after>﻿# How To Post Questions

This is the text version of the rules. The official rules are in list form:  
[Official Rules](./Rules.md)

The idea of this text is that you do not have to read a list and also get some more advice on how to write good questions and answers. The list has two other advantages: It is directly on facebook (in our group) and it is a list so we can reference the number of a rule.

# Moderation

All posts are reviewed before they appear in the group to be answered. Requests for membership are moderated too.

# Allowed Topics

Posts must be about Java, C, C++, C#, Android, PHP, Computer Science and so on. Always state in your post what topic it is about.

No contest questions, no adverts, no job adverts, no spam, no religious, political, nationalistic, sexist, homophobic, and so on.  
There are other groups for job adverts. Posting them in our group will lead to a permanent ban.

# Language / Code

Posts in standard English only. No slang, txtspk or l33tsp33k.  
It doesn’t have to be perfect English, but at least use complete words and sentences. English is by far the most important Language for you as a computer scientist. Learn it!

Source code should not be directly in the text (unless it’s just two or three lines). Use any of the following sites to paste your code and post a link to it.

*   [pastebin](https://pastebin.com/)
*   [gist/github](https://gist.github.com/)
*   [codepad](https://www.codepad.org/)
*   [pastie](http://pastie.org/)

Full Tutorial: [How to paste Source Code](http://java-queries.rhcloud.com/how-to-paste-source-code/)

# Example

If your question looks like this it will probably be approved:

* * *

> **<NAME>:** [Java/OOP:] I have 3 Java classes: [http://pastebin.com/qQ3Wpkkr](http://pastebin.com/qQ3Wpkkr)  
> I create an object like so:  
> Teacher t = new Teacher(“001”, “<NAME>”)  
> Then I want to see the “info” like this:  
> System.out.println(t.getInfo());  
> I get “I’m a Teacher. My ID is null and my name is null”.  
> But I expected “I’m a Teacher. My ID is 001 and my name is <NAME>”  
> Where is my mistake? Note that I did use final keyword. Why are both null, even though I never assign null to those fields?

* * *

It is good because:

*   It starts with the topic (in this case: Java and OOP).
*   All code is linked on pastebin.
*   It explains what has been tried out.
*   It tells the actual and the expected output.
*   It describes what has already been tried out (using final keyword).

# How to ask good questions

If you are a raw novice, don’t be afraid to ask – there are no stupid questions.

**State your goal!** That is the most important information to answer your question. This text explains how to ask questions the smart way:  
["How To Ask Questions The Smart Way"](http://www.catb.org/esr/faqs/smart-questions.html)

Try to provide a _short, self contained, correct example_: ["The SSCCE"](http://sscce.org/)

Tell us what result/output you expect. The compiler and the runtime rarely do anything wrong, so don’t claim the output is _wrong_. It isn’t – your code is.

Before you ask, **use Google** and read your Java **textbook**, and the [Java API specs](http://docs.oracle.com/javase/8/docs/api/ "Java™ Platform, Standard Edition 8 API Specification"). There’s no point in asking something that can be answered by a quick google search.

If you are looking for a book or software then check our [top recommended java books](../Books/Recommended_Books.md "Top Recommended Java Books") instead of opening a new thread.

Start your post with the topic (e.g. OOP, Android, Networking).  
[Don’t start with “Can I …”. If you could, you wouldn’t have to ask.](http://java-queries.rhcloud.com/can-i/ "Can I …?")  
[Don’t start with “How can I …”. There are a million ways, we can’t list all.](http://java-queries.rhcloud.com/how-can-i/ "How can I … ?") Instead, state how you want to do it.  
Don’t start with “Is is possible …” – it is in most cases.  
Generally don’t ask anything that can be answered by:  

> **“Yes, by writing the appropriate code.”**
{'fraction_non_alphanumeric': 0.09852801519468186, 'fraction_numerical': 0.003798670465337132, 'mean_word_length': 3.6988287785833798, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 9, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4291622', 'n_tokens_mistral': 2571, 'n_tokens_neox': 2484, 'n_words': 1266}