Can't Remember the code..

Discussion in 'Plugin Development' started by Jacksonbanan, Oct 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Jacksonbanan

    I want to learn java, I am trying as hard as I can but the biggest and the only problem is that I can't remember the code, I tried to get it in my head for a really long time but I can't.
    Please help :(

    Thanks!
     
  2. Offline

    Fozie

    I know it is frustrating but this is a forum for the bukkit api not java it self.
    I dont know how we should help.
     
  3. Offline

    felixfritz

    Starting java with bukkit might not be such a great idea. Start by creating "normal" java code, perform simple tasks such as adding numbers together, displaying them, start using loops, start expanding your code to different methods, try and make your own objects and learn how to use them. Then you will start seeing things differently and understand way more when you come back to bukkit plugins.

    It's not so much about remembering, it's more about understanding.
     
    Hutchmaster99 and Jacksonbanan like this.
  4. Offline

    caseif

    Jacksonbanan likes this.
  5. Offline

    Fozie

    Personal recommendation youtube.com/thebennybox he is the greatest in explaining stuff.
     
    Jacksonbanan likes this.
  6. Offline

    Gater12

    Jacksonbanan I couldn't remember code either when I first started. I would always go back in videos/forums. Again, you can start out by making simple Java projects, and what you do frequently you will remember. Like in the Java For Dummies book, programmers remember stuff that they do over and over again. What you don't do often, you forget.
     
    Jacksonbanan likes this.
  7. Offline

    1Rogue

    What helps is not to "learn the code" but to understand the concepts behind programming itself. If you know what x function and y function do, but don't understand how functions work or how objects work, then it doesn't really help to know all of that. Try making sure that you understand the flow of coding as well (i.e. variables, for-loops, streams, classes), and then the rest comes much easier through association (What is a for-loop in java? C++?)

    Edit: Don't use youtube. Video tutorials are godawful.
     
    Jacksonbanan and Blah1 like this.
  8. Offline

    MrSparkzz

    ShadyPotato
    TheBCBroz are not very reliable, although they might be able to do a lot with coding, their code is very messy and it promotes bad habits.
     
  9. Offline

    Botifier

    would this help?
    Code:java
    1. class hello {
    2. public static void main(String[] args) {
    3. System.out.println("Hello World!")
    4. }

    remembered it by heart
     
    Fozie and Gater12 like this.
  10. Offline

    Blah1

    Adding to what 1Rogue said, it's important that you understand the concept but more importantly, practice praictice practice! Whenever I want to learn something new in bukkit, I make like 4-5 plugins on it (differet ones) just to make sure I understand it fully. Also, if you think something is important (events, command basics, etc), don't move on until you have learnt it FULLY...because if you don't have a good foundation, your code probably won't work because you may have had errors in the areas you are not stong at.

    I hope that made sense :D
    PS. We are all learning. I dont care if you are dinnerbone or you are just starting off, we all go through this. So don't think you are alone.
     
    Jacksonbanan likes this.
  11. Offline

    waicool20

    This is why we have IDEs lol
     
  12. Offline

    Gater12

    Botifier Probably the first thing every Java programmer knows how to do.
     
  13. Offline

    Botifier

  14. Offline

    1Rogue

    Do I win a medal?

    Code:java
    1. package com.rogue.hello;
    2.  
    3. public class HelloWorld {
    4.  
    5. public native void hello();
    6.  
    7. public static void main(String[] args) {
    8. System.loadLibrary("hello");
    9. HelloWorld sample = new HelloWorld();
    10. sample.hello();
    11. }
    12.  
    13. }


    Code:c
    1. /* DO NOT EDIT THIS FILE - it is machine generated */
    2. #include <jni.h>
    3. /* Header for class HelloWorld */
    4.  
    5. #ifndef _Included_com_rogue_hello_HelloWorld
    6. #define _Included_com_rogue_hello_HelloWorld
    7. #ifdef __cplusplus
    8. extern "C" {
    9. #endif
    10. /*
    11. * Class: HelloWorld
    12. * Method: hello
    13. * Signature: ()V
    14. */
    15. JNIEXPORT void JNICALL Java_com_rogue_hello_HelloWorld_hello
    16. (JNIEnv *, jobject);
    17.  
    18. #ifdef __cplusplus
    19. }
    20. #endif
    21. #endif


    Code:c
    1. /* hello.c */
    2. #include <jni.h>
    3. #include <stdio.h>
    4. #include <signal.h>
    5.  
    6. JNIEXPORT void JNICALL Java_com_rogue_hello_HelloWorld_hello
    7. (JNIEnv * env, jobject jobj)
    8. {
    9. printf("Hello World!\n");
    10. return;
    11. }


    prints:
    Code:
    Hello World!
     
Thread Status:
Not open for further replies.

Share This Page