Search:

Type: Posts; User: andbin

Page 1 of 20 1 2 3 4

Search: Search took 0.32 seconds.

  1. Re: Adding Binary numbers in array element by element

    No, sorry, your code is extremely too long and complex. If I would show you my implementation you would be .. literally "shocked". ;)
  2. Re: What is wrong with my code?? Program: Count the number of consonants in a given string

    First of all, the line with toCharArray can better be outside (before) the loop. It's a thing that doesn't change in the loop. It's also preferable a for loop instead of a while.

    But the big...
  3. Replies
    3
    Views
    68

    Re: BigDecimal rounding problem

    HALF_UP: Behaves as for RoundingMode.UP if the discarded fraction is ≥ 0.5; otherwise, behaves as for RoundingMode.DOWN

    the 4 is not ≥ 5 ;)
  4. Thread: Inexcusable !

    by andbin
    Replies
    3
    Views
    68

    Re: Inexcusable !

    JDK version/IDE version?

    Seems really strange because ...


    public class AnnotTest {
    public static final String SOME_STR = "aConstant";

    @MyAnnot(SOME_STR)
    private String item;
  5. Replies
    4
    Views
    75

    Re: Abstract Class with non abstract method

    A class is marked abstract when it makes no sense to instantiate it. Think about a Figure2D class and some subclasses like Circle, Triangle, Rectangle, etc.
    Do you think has sense to do new...
  6. Replies
    2
    Views
    50

    Re: Problem using modpow BigInteger

    modPow


    Always see javadoc documentation!
  7. Re: GUI won't appear after using setVisible(true)

    The use of a ServerSocket with the classic while(true) loop containing the accept() MUST be done in another thread, not in the Event Dispatch Thread. You are keeping busy the EDT, thus your UI cannot...
  8. Replies
    3
    Views
    85

    Re: How to convert string of date to date

    Since the format is "custom", then java.text.SimpleDateFormat


    (Norm beated me for 1 min.) ;)
  9. [SOLVED] Re: error: expected Please Help? Researched and still clueless

    You cannot put a statement directly as class member (outside methods/constructors).
    Declare and assign the s variable into the main.
  10. Re: Capture Other's PC Screen and Send it's Data to display in My Own PC

    Ok ... have a try. But you will soon find that this entire process in loop (capturing with Robot, streaming the image with ImageIO, sending on network) is very "heavy", both for time and also network...
  11. Replies
    4
    Views
    94

    [SOLVED] Re: Getting a error please help!!!!

    markmywoods: you need an operator (+ - etc.) after 4/3 and after (1/d) and before (b*b*b)
    Note also that Math.Pi is wrong. There exists a Math.PI which is a constant.
  12. Re: Preference (Method Overriding and Method Overloading)

    They exist for different reasons! Overloading gives you flexibility. Think about, for example, the classic println methods in System.out (that is a java.io.PrintStream):

    void println(boolean x)...
  13. [SOLVED] Re: Try And Catch Isn't Working And One More Problem

    @Andrew6110: honestly, I can't help you so much if you don't explain something more general about your application.

    Why are you using a new Thread just only to wait some time and do a little...
  14. [SOLVED] Re: Try And Catch Isn't Working And One More Problem

    I don't know anything about your game, parachutes, scenes etc. I just see the use of multi-threading (two or more threads). And multi-threading is critical and requires a good knowledge about...
  15. [SOLVED] Re: Try And Catch Isn't Working And One More Problem

    @Andrew6110: the first thing I notice is that you access and modify some variables from different threads. Certainly the g.currentScene variable.

    This requires some special care, that I suspect...
  16. Re: How to draw a string without transparent window

    First, painting directly into a JFrame overriding the paint(Graphics) is generally not a good approach. JFrame is a complex component, more than the "old" AWT Frame class. You should be aware of...
  17. Replies
    7
    Views
    102

    Re: copyInto() failed

    An Integer object cannot be stored in a Double[] or Long[] or other. Solely in a Integer[] / Number[] / Object[] array object.
    In other words only in an array whose real component type is a...
  18. Replies
    11
    Views
    125

    Re: Why indexOf does NOT return -1?

    When you use indexOf (any of the versions) you should (quite) always check the return value. Because -1 means "not found".
    Unless, and I repeat unless, -1 is directly appropriate for anything else...
  19. Replies
    7
    Views
    102

    Re: copyInto() failed

    The problem can be resolved only clarifying your intentions! Why do you need a Double[] ? Why are you doing a

    t.addAll(r);

    ?
    Since t is defined and assigned outside the while, you are...
  20. Replies
    5
    Views
    102

    Re: JTable only populating one row of data.

    If you want that your program downloads that file, yes, it's possible. Start from the URL class to define the url of that document. Then open the connection (openConnection()) to obtain a...
  21. Replies
    7
    Views
    102

    Re: copyInto() failed

    From javadoc documentation of copyInto:

    IndexOutOfBoundsException - if the specified array is not large enough to hold all the components of this vector

    You have added 5 elements but the output...
  22. Replies
    7
    Views
    102

    Re: ocr from an image

    Sorry but you have asked a very tough question. OCR (Optical Character Recognition) is a very complex topic that cannot be easily explained.
    I know very few about this topic. However, in general,...
  23. Replies
    11
    Views
    125

    Re: Why indexOf does NOT return -1?

    If the question is: why indexOf accepts a negative value for the fromIndex parameter .... it's easy: inspecting the source code of java.lang.String you can find a thing like this:


    if...
  24. Re: Capture Other's PC Screen and Send it's Data to display in My Own PC

    For Robot it is to be intended the java.awt.Robot class. Please see official javadoc documentation. ;)
    And even when you have the BufferedImage, you cannot directly send it onto an OutputStream of a...
  25. Thread: jcreator

    by andbin
    Replies
    1
    Views
    65

    Re: jcreator

    Sorry but your question is totally incomprehensible. Try to explain your problems in a better way. Please, clarify the context (e.g. is it a Swing application?) and what you have done so far about...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4