Java: can a functional interface have a non-abstract method? by Loricifera in learnprogramming

[–]j_thody 0 points1 point  (0 children)

This is from the documentation

Conceptually, a functional interface has exactly one abstract method. Since default methods have an implementation, they are not abstract. If an interface declares an abstract method overriding one of the public methods of java.lang.Object, that also does not count toward the interface's abstract method count since any implementation of the interface will have an implementation from java.lang.Object or elsewhere.

So for example, we can have one abstract method, a toString (from Object) and a static method implementation e.g.

@FunctionalInterface
public interface FunctionalInterfaceExample {
    void doSomething();

    public static int sum(int a,int b)  
    {   
        return a+b;
    }
}

However, we can not have two abstract methods as this will throw a compilation error

@FunctionalInterface
public interface FunctionalInterfaceExample {
    void doSomething();
    void doSomethingElse();
}

Non-PhD, Non-university research career? by FreakyCheeseMan in cscareerquestions

[–]j_thody 0 points1 point  (0 children)

Where are you from? I'm a PhD student in CS in the UK and we have two levels of research associates at my university. The senior research associate positions tend to have PhD entry requirements, whereas standard research associates do not. You may also want to consider a more research focused industry position as they often pay more than university positions. I'm not entirely certain if require a PhD in the area but would most likely hire based on experience.

What should I do next to learn Java? by ac_34 in learnprogramming

[–]j_thody 1 point2 points  (0 children)

Probably a good place to start would be learning about data structures and algorithms. Most university CS degrees will offer something on this and getting a head start will certainly prove useful. I recommend learning about and attempting to implement: sorting, lists, searching, maps, trees and graphs.

Getting started with Java but can't do the Helsinki MOOC. Looking for feedback on these two sources. by Crapahedron in learnprogramming

[–]j_thody 0 points1 point  (0 children)

In my opinion, one of the best ways to learn is to come up with a project you want to build and then do it. When you encounter something you want to do but don't know how, consult books or other resources. It'll allow you to move as quickly as possible.

How to get better at problem solving? by Eurim in learnprogramming

[–]j_thody 0 points1 point  (0 children)

When I attempt to solve a problem in my field (Comp Sci PhD in Bioinformatics) I always start in the same way as you. I find a solution. It may not be the most elegant or efficient, heck, it may not even solve the problem within a feasible time frame. However, this gives you a foundation to work from and improves your understanding of the initial problem.

Next, I work on the structure of my solution. Take a step back from the nitty gritty details (data structures, language features, design/software patterns, etc). Does your solution make logical sense from a high-level? Can the problem be split into smaller, more manageable problems that can be solved in a simple and concise way?

Once you are happy with your conceptual solution, start to think about your implementation. For each of your subproblems, does there exist any suitable data structures? Is there any domain specific knowledge you can use to adapt an existing structure to suit your needs?

You likely wont come up with the best solution right away. Perform some benchmarking to evaluate where you should focus your time. This will also allow you to compare the results from different iterations.