Java_Junior

u/Java_Junior


r/AskProgramming•

I'm fuming pretty hard right now, and just wanted to commiserate with other job-seekers.

I had the opportunity to interview for a large company in California for a Java developer position. Previously I have 2 years experience in Java.

This company sent me two tests: one of them was a single question, to develop an algorithm that adds huge strings of numbers together without using any conversion. My webcam had to be on, recording my face the entire time, and I was not allowed to use documentation or tab out or anything. I was okay with this one even though I found it to be overkill.

The second test was a THREE HOUR LONG, 60 QUESTION TEST with tons of questions like "Will this extrem

15256

r/AskProgramming•

I'm a junior dev. I recently read a story posted on r/learnjava about a guy who was given a coding challenge that required he write a program that prints out the first 30 or so numbers of the fibonacci sequence.

Without looking at his code, I tried to complete the same challenge. I ended up with a small program that accomplishes the goal:

public class Fibonacci {

    public static void main(String[] args) {

        int fibonacciNumber = 0;
        int firstPreviousNumber = 1;
        int secondPreviousNumber = 0;

        System.out.println(secondPreviousNumber);
        System.out.println(firstPreviousNumber);


        while (fibonacciNumber < 5000)
227

r/learnjava•

I saw another redditor post here recently that he was given a test at a job interview where they asked him to write a program that prints the fibonacci sequence.

I tried to build this program without looking at any examples. This is what I came up with:

public class Fibonnaci {

    public static void main(String[] args) {

        int fibonacciNumber = 0;
        int firstPreviousNumber = 1;
        int secondPreviousNumber = 0;

        System.out.println(fibonacciNumber);


        while (fibonacciNumber < 5000) {

            fibonacciNumber = firstPreviousNumber + secondPreviousNumber;
            System.out.println(fibonacciNumber);

     
3113

r/learnjava•

I'm a junior developer in Java and I've been with my company a little over a year. This is my first programming job. I knew a little bit of Python coming in, but they needed me to do Java, so I started off learning with Herbert Schildt's book, 7th ed.

The first half of the book is pretty great, but Schildt has some really unusual habits with regard to naming conventions and declarations. By the time I got to Generics and Lambdas, I could barely read his code anymore, and it's really affecting my ability to learn the more complex topics.

Just wondering if anyone could recommend to me a book that covers Generics

410


r/tipofmytongue•

This is not The Shining. I'm thinking of a tv movie or series about a group of strangers who get trapped in some kind of mountain lodge due to an intense blizzard. Occasionally someone leaves the lodge and dies or vanishes. I want to say it was written by or based on a Stephen King work but I can't remember. This was in the early to mid-90s.

114

r/learnprogramming•

In my CS book, I'm given the following equation:

f(x, y, z) = (x + y) . z-bar

"-bar," by the way, means there's a line over the z.

I'm then given a truth table that includes this line:

x y z || f(x, y, z) 0 1 0 || 1

How we arrive at output 1 is explained like this:

"In this expression, since y is 1, it follows that

x + y = 1 and thus 1 . 0-bar = 1 . 1 = 1."

This makes no sense to me. The book does not explain what bars are. My buddy, who is a physics teacher, tells me that the . in these equations means "both true" instead of "multiply." The book also does not say that.

Can anyone explain like I'm five?

28

r/learnjava•

I've got an application with six FXML textFields, where a user can provide six String inputs. These inputs are checked against a list of 31 names. If each String is not one of the names on the list, it's rejected.

I've gathered the Strings into an Array, and I'd like to check if they are unique (so the user cannot enter the same input more than once). But I've got no idea how to go about doing this!

What do you suggest, Java gurus?

2319

r/learnjava•

In my program, a user provides a name (String) as input. Then, the program checks that String against a List<String>:

if (listOfNames.contains(nameOneField.getText()) && 
listOfNames.contains(nameTwoField.getText())) {
...
}

I'd like for this code to ignore case on the user's input. I've used equalsIgnoreCase() from the String class before, but I'm not sure that will work here. What's the best way to do this?


EDIT:

Hey everyone, I spoke with my boss, and he made an elegant suggestion:

String nameOne = nameOneField.getText();
String nameTwo = nameTwoField.getText();

String nameOneLowerCase = nameOne.toLowerCase();
148

Hey everyone. so I'm working my first programming job, and I've been at it for about 11 months. I'm actually from a teaching background and do not have a great knowledge of CS fundamentals. I studied Python with a tutor for a year, and he later hired me on at his company when a junior position opened up.

I'm now working on our flagship app and my boss has requested I get a deeper understanding of CS fundamentals - data structures, CPU, memory, etc. I've built gaming PCs from scratch for most of my life so I have a gamer's understanding of these components, but I don't actually know anything about transistors, binary, data structures modeled on the way computer memory works, etc.

Could an

310

r/learnjava•

I'm doing the challenges on CodingBat.com and got stopped at this one:

Given a string, return a new string where the first and last chars have been exchanged.

frontBack("code") → "eodc"

frontBack("a") → "a"

frontBack("ab") → "ba"

Here is my solution, which does not work, but the in-browser compiler does not explain why:

public String frontBack(String str) {

   if (str.length() <= 1) {

    return str;

  }

  String exchangedString = "";
  String concatenatedString = "";

  char beginning = str.charAt(0);
  char end = str.charAt(str.length() - 1);

  exchangedString = str.substring(0, str.length() -1);

  conca
02

r/learnjava•

I'm studying the Generics chapter in Herbert Schildt's Java: A Beginner's Guide, 7th Edition, and I'm not exactly clear on one of the examples.

The full program:

class TwoGen<T, V> {

    T object1;
    V object 2;

    TwoGen(T obj1, V obj2) {

        object1 = obj1;
        object2 = obj2;
    }

    System.out.println("Type of T is " + object1.getClass().getName());
    System.out.println("Type of V is " + object2.getClass().getName());

    // getters

    T getObject1() {
        
        return object1;
    }

    T getObject2() {

        return object2;
    }
}

second class:

class SimpleGen{
101

r/learnprogramming•

I'm a junior at my company (working in Java) and I want to start learning more about design patterns. Right now I'm able to work on existing projects, but designing my own small projects has been an exercise in frustration. Basically my boss has to help me reorganize my code into different modules/classes/packages because my architecture is sloppy.

My boss has Clean Architecture by Robert C. Martin but I think this might be a bit advanced for me.

I have read online articles on [MVC](https://en.wikipedia.org/wiki/Mode

14

r/learnprogramming•

I'm a junior at my company (working in Java) and I want to start learning more about design patterns. Right now I'm able to work on existing projects, but designing my own small projects has been an exercise in frustration. Basically my boss has to help me reorganize my code into different modules/classes/packages because my architecture is sloppy.

My boss has Clean Architecture by Robert C. Martin but I think this might be a bit advanced for me.

I have read online articles on [MVC](https://en.wikipedia.org/wiki/Mode

24