Search:

Type: Posts; User: AngleWyrm

Page 1 of 2 1 2

Search: Search took 0.11 seconds.

  1. Replies
    1
    Views
    110

    Re: Csv file and object

    Example load() function
  2. Re: Is there an algorithm to find a concentration of points?

    https://youtu.be/FgakZw6K1QQ
  3. Re: Is there an algorithm to find a concentration of points?

    Check out Principal Component Analysis
  4. Replies
    3
    Views
    476

    Re: Need help modifying a method

    You haven't taken my advice, so why should I expect even more such advice would be useful?

    I do have an opinion: The habitual and pedantic use of single-letter variables is a hold-over from...
  5. Replies
    3
    Views
    476

    Re: Need help modifying a method

    rename the variable i to index.
  6. [SOLVED] Re: How can I format my string output in Java?

    int someInt = 3;
    float someFloat = 1.225;

    System.out.println(
    String.format("Integer value: %s, float value: %f", someInt, someFloat)
    );

    String formatting codes
  7. Replies
    1
    Views
    398

    Re: manipulation of a string

    final String myImmutableString = "hello";
    String ordinaryString = " world";

    myImmutableString += ordinaryString;
  8. Re: Just joined to be part of Java community!

    Java video course https://youtu.be/-C88r0niLQQ
  9. Replies
    1
    Views
    655

    Re: Separate a big junk of text from main?

    12x40 = 480 words. Since they've been declared as constant, just make them constants.

    Constants.java

    public class Constants {

    public static String[] MY_PHRASES = {
    "first phrase",
    ...
  10. Replies
    1
    Views
    764

    Re: ArrayList.size()

    public class ArbitraryClass {
    private Integer someValue = 0;

    ArbitraryClass(Integer construction_initializer){
    someValue = construction_initializer;
    }

    } // ArbitraryClass

    import...
  11. Replies
    2
    Views
    855

    Re: Java Question

    I would create a function compareInts(int A, int B) that returns a string {"less than", "equals", "greater than"}
    Then how to generate 60 comparisons would become a separate chore, and entirely up...
  12. Replies
    2
    Views
    749

    Re: Will my program work every time?

    https://i.imgur.com/sWkT38M.png
    yes it considers each of the three ranges.

    If the program falls through all three if statements, then maybe variable vodki = null. But if vodki = null, then if...
  13. Re: Calculate end date based on date selected

    Periods, duration, date and time arithmetic in Java 8+
  14. Re: How to find maximum, minimum and occurence time of index in an array list

    I wrote a solution but was advised against posting complete solutions, as it tends to attract those who want only to pass a test without exercising skill. There's some loss of learning by example,...
  15. Replies
    10
    Views
    734

    Re: Printing ArrayList

    Java String.format specifiers
  16. Replies
    3
    Views
    1,563

    Re: switch statement related exercice

    Here's another way to store the data for easy lookup. There's a product code such as 'A' for apple, which can then be used to look up the details of apples.

    import java.util.HashMap;
    public class...
  17. Re: boolean statement in do loop not workling for string

    static Boolean getAnswer(){
    System.out.print("Shall we continue? ");

    Scanner scanner = new Scanner(System.in);
    String input = scanner.nextLine();

    if(...
  18. Re: Cannot convert this pseudo code line to java??

    import java.util.Arrays;
    import java.util.List;
    public class Main {
    public static void main(String[] args){

    // create an array of integers
    Integer[] intArray =...
  19. Replies
    3
    Views
    1,103

    Re: Suggested answer wrong?

    The link you gave points to Write a Java program to Compute the sum of the prime numbers till 100
  20. Re: Please help me to find out the error in the following code

    import java.util.Arrays;

    public class Main {
    public static void main(String[] args){

    // simple class
    class MyClass{
    Integer x = 100;
    // initialization constructor
    ...
  21. Re: Please help me to find out the error in the following code

    Is it possible to override this behavior through the use of a default constructor?
  22. Re: Please help me to find out the error in the following code

    I notice this behavior of array of myclass objects doesn't seem identical to the behavior of, say an array of booleans

    boolean[] destinationBag;

    // load a destination bag with second bag's...
  23. Re: Please help me to find out the error in the following code

    The array created in the original code needs a bit where the array elements are created.

    Here's a version that doesn't throw a run-time exception.
    public class Main {
    public static void...
  24. Re: Please help me to find out the error in the following code

    Exception in thread "main" java.lang.NullPointerException at Main.main(Main.java:20)

    Is there a line numbering feature for this forum's code boxes?
  25. Re: Please help me to find out the error in the following code

    I'm also getting a runtime null pointer exception with this version when MyClass.set(int) is called, and I suspect it has to do with the creation of the array elements.

    public class Main {public...
Results 1 to 25 of 34
Page 1 of 2 1 2