Search:

Type: Posts; User: janpiel

Page 1 of 2 1 2

Search: Search took 0.09 seconds.

  1. Re: removing special characters from a string, and help finding an extra space in string output

    The array at position 2 (the a) has not a real char value. So you must either:



    // stepthrough the sentence array, get the first character
    // of each string @ each index, and store...
  2. Re: Trying to trim and get length then parse from string into Double

    Take a look at :
    String (Java Platform SE 6)
    and
    Double (Java 2 Platform SE v1.4.2)

    Here's an small example



    try{
  3. Replies
    1
    Views
    1,804

    Re: Permutations using Arraylist

    The first problem is that you operate on only two Arraylists. Both exist on the heap and not - like you may think - on the stack of the recursive calls. So after the the first three calls the...
  4. Re: Generalizing actions for a binary tree traversal?

    Take a look at this:


    public static interface IFunction<T> {

    public void callFunction(T t);

    }

    private static IFunction<String> functionPointer = new IFunction<String>() {
  5. Re: Finding the lowest integer using sentinellvalue. :( I am stuck!

    Of course!!! You are right. There I was a little bit blockheaded:)
  6. Replies
    1
    Views
    1,541

    Re: Proper way to cast generics?

    The problem is that the type of the value of the map is the wildcarded type Collection<EventHandler<? extends Event>>. To this type you can cast. When you write your method, it returns a concrete...
  7. Replies
    6
    Views
    2,959

    Re: A networking quiz game idea

    The program would be more convenient with different threads because the main thread stops every time you call server.accept() and stream.readUTF() Both methods stop the thread in which they are...
  8. Thread: Java Based OS

    by janpiel
    Replies
    5
    Views
    1,449

    Re: Java Based OS

    If you think of an OS like - for instance - a linux kernel which you can install on a hard drive. That's impossible. Java needs a VM and thus a basic OS. There is no way to evade these fact. But I...
  9. Re: Finding the lowest integer using sentinellvalue. :( I am stuck!

    You should use dynamic structures in this case:



    public static void main(String[] args) {
    ArrayList<Integer> inputVals = new ArrayList<>();
    Integer temp = 0;
    Scanner scanner = new...
  10. Replies
    6
    Views
    2,959

    Re: A networking quiz game idea

    I think so. I'm not a java networking expert and I dont know the best practices. Anyway here's a small example

    Client impl:


    package example.socket;

    import java.io.DataOutputStream;
    import...
  11. Replies
    6
    Views
    1,840

    Re: Is Java 7 not available with Jgrasp?

    I strongly recommend to use Netbeans and JavaFX Tools when you want to develop GUIs in JavaFX. It's the native IDE for the framework.

    JavaFX : JavaFX Tools
    Netbeans: JDK 7 with NetBeans
  12. Replies
    6
    Views
    2,959

    Re: A networking quiz game idea

    I think that there exists no better language to do network programming like java. There exist several frameworks and standard specifications in any scale.

    One of the core and basic technics are...
  13. Replies
    3
    Views
    3,386

    Re: Multiple Class Calculator

    The two inputs results from the two constructor calls(you make the input operation in the constructor):
    First:


    public static void main(String[] args) {
    calc_main c=new calc_main();


    and...
  14. Re: How do I process an Arrays.toString in reverse order????

    The easiest way is to use Long.toBinaryString but I think that's not the purpose of the thread;)
    If you have a JDK you can also check the source of the toBinaryString-method there you can find a...
  15. Replies
    3
    Views
    2,439

    Re: Help with traversing a maze recursively.

    The simplest way should be an extra break condition where you compare the parameters r and c to the row and column class var. But I'm not sure if you will go through the maze the right way then. ...
  16. Replies
    3
    Views
    2,439

    Re: Help with traversing a maze recursively.

    It happens at the exit of the maze. The exit condition doesnt work in this case becaus there is no wall.


    char[][] test = new char[][] {
    { '*', '*', '*', '*', '*' },
    { '*', ' ', ' ',...
  17. Replies
    3
    Views
    1,554

    Re: 1 class heir from 2 others?

    Regadring the interface view of multiple iheritance, you could use two or more interfaces, it will work.

    Apart from that you can simulate multiple inheritance by declare and instaniate abstract...
  18. Replies
    5
    Views
    1,092

    Re: Boolean value prints out the wrong one.

    Just a hint from a programmer, it's bad style to exit methods or return values in functions in more than one line. I didnt mean it in a bad way.
  19. Replies
    5
    Views
    1,092

    Re: Boolean value prints out the wrong one.

    you make an assignment:

    test = true means in java that you set the var test to true. And in java the assignment return its value so it allways true

    Give (test == true) a try.

    P.S.
    In pascal...
  20. Replies
    6
    Views
    1,341

    Re: Recipe Book Help again

    I m not sure, cause i cannot debug the code due to the missing Recipse class(I know it's easy to implement but it's late;)

    but I think the start value of currentRecipeNumber is wrong. You...
  21. Replies
    7
    Views
    2,121

    [SOLVED] Re: help with java game source code..moving object

    If you have Netbeans and JavaFX in your enviroment, then give that a try:


    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package ztest;
    ...
  22. Replies
    2
    Views
    1,974

    Re: Adding maven plugin to Eclipse Ide

    I dont know how to resovle this but if you have a newer versionof eclipse then give the marketplace a try. Search there for maven and you will find the plugin. if I remember right you can install it...
  23. Replies
    4
    Views
    1,355

    Re: Encapsulation (getters and setters) Tips?

    And be careful with encapsualting complex objects. Strings Integer and so are allways new initialized during assignments but check this for instance:



    public static class...
  24. Replies
    2
    Views
    976

    Re: problem returning array

    The reason isin the questionMissed-method


    for (int i = 0; i < questionWrong.length; i++) {
    if (!userAnswers[i].equals(correctAnswers[i])) {
    i =...
  25. Replies
    8
    Views
    963

    Re: maintain value of integer

    Check the functionality of postincrement and preincrement


    return ++i;

    will work
Results 1 to 25 of 28
Page 1 of 2 1 2