Search:

Type: Posts; User: zemiak

Page 1 of 2 1 2

Search: Search took 0.07 seconds.

  1. Re: Debugging with Print Statement (on List of Object Class)

    int[][] intervalNumbers = { { 1, 3 }, { 2, 6 }, { 8, 10 } };

    for (int[] temp : intervals) {
    ll.add(new Interval(temp[0], temp[1]));

    means, get inner arrays in loop:
    temp = { 1, 3 }
    ...
  2. Replies
    3
    Views
    1,402

    Re: What does this java code do?

    public class A {
    static int a = 0;
    static long b = 100;

    public static void main(String[] args) {
    for (;;) {
    System.err.println( a++);
    if (a > b)
    break;
    ...
  3. Replies
    1
    Views
    660

    Re: User input string's problem

    String is object, == compares
    if two objects are exactly same, not
    if they have stored same values "a"
    use
    x.equals("a")
    for better result
  4. Replies
    2
    Views
    738

    Re: Sorting LinkedList

    sortList() is working,
    might something in rest of LinkedList can be wrong
    (I suppose you wrote your own LinkedList class)
  5. Re: can someone help me understand why i am getting this error.

    by input:
    10 20

    you get:
    new b1( x=10; ref=null)

    element = b1
    while() {
    element = b1.ref // null
    }
  6. Replies
    8
    Views
    1,061

    Re: GUI freezes instead of showing JProgressBar

    The graphic of code that you posted correctly displays a progressbar, albeit in an infinite loop.
    The problem may be how calculate or get value of boh variable, and if there is correct increment...
  7. Re: My first java code won't run from cmd Windows

    C:\Program Files\Java\jdk-17.0.2\bin
    C:\Program Files\Java\jdk-17.0_2\bin

    find one difference
    0.2
    0_2
  8. Replies
    4
    Views
    1,915

    Re: Java String Pool - Beginner Question

    local final String is constant like literal String
    two literal constants concatenated by + ,can be stored in the pool
    as compile-time optimalisation like


    String s7 = "AB"+"C";...
  9. Replies
    5
    Views
    2,005

    Re: how can we learn java

    especially support for beginers is here
    https://www.sololearn.com/home

    better accessed by app
    coding by online IDE
  10. Thread: trim

    by zemiak
    Replies
    2
    Views
    671

    Re: trim

    your code returns Command or int,
    only one is correct
  11. Replies
    4
    Views
    719

    [SOLVED] Re: Struggling with generics

    use wildcard Class<?>



    import java.lang.reflect.Method;

    class Class_forName_test {
    public static void main( String[] args) throws Exception {
    String className = "javax.swing.JMenu";...
  12. Replies
    4
    Views
    755

    Re: My friend cant install java plz help

    official Oracle Java SE download is this
    https://www.oracle.com/java/technologies/downloads/#jdk17-windows
  13. Replies
    2
    Views
    744

    Re: int from main method to non-static method

    learn about method parameters



    newVend.Secondary( price, paid);
    }
    public void Secondary( Double price, int paid) {
    System.out.println("price is " +price);
    ...
  14. [SOLVED] Re: String problem ..kindly give me a code in alternative methods

    String str = "My name?It's me Sumon?There was a logic behind it.where is the basic knowledge?i can go the the room.";
    String[] splited = str.split( "(?<=[\\.|\\?])" );

    for (String s:...
  15. Re: [Beginner] How to add a new object to an object array?

    after start arr.length is 0, then can't do
    if (arr[0] == null)
    because [0] doesn't exist

    countElements can't be static in situation of two sets with different length



    public boolean...
  16. Replies
    3
    Views
    642

    [SOLVED] Re: Looking for a second opinion

    Hiding informations is not about speed, it's about
    . maintaining a large projects,
    it is easier to rewrite or change part of code if not direct depending on others parts.
    change probably does not...
  17. Replies
    3
    Views
    642

    [SOLVED] Re: Looking for a second opinion

    also it is possible to store temporary results to array
    and print it in separated method or in main()
    but this is more demonstrative



    import java.util.Scanner;

    public class RecursionPower...
  18. Thread: Do - While Loop

    by zemiak
    Replies
    1
    Views
    576

    Re: Do - While Loop

    this code works as I expect and ends after 0.
    What you have in main() ?
  19. Re: Multiple selection (bounding boxes) in displayed image

    Java is not Javascript
  20. Replies
    1
    Views
    719

    Re: Need help in making simple java program

    add your code here
  21. Re: Multiple selection (bounding boxes) in displayed image

    this is Java forum
  22. Replies
    1
    Views
    530

    Re: Java FX problem with Rectangle Intersects

    look if intetsects() is true after moveDOWN()
    and if move down snd up works in this situation, because result is stop move
    look at loop where check() is called if its condition is still true
    do...
  23. Replies
    1
    Views
    528

    Re: Learning java (beginner) - code error

    there is no attachments, copy your code and error message here
  24. Re: Main.java expects Person.java behavior to work. How can I solve this?

    what is in Main ?
  25. Re: Got problem calling method from inherited aggregation

    SiteEntry.browseInfo can't be static in



    class SiteEntry extends BrowseAction implements CommonStat {
    private static BrowseInfo browserInfo;


    for understand it try this simple...
Results 1 to 25 of 37
Page 1 of 2 1 2