Tagbangers Blog

Java

Getting Started with JUnit

When I started learning how to code, I had no idea that there was such thing as a "test" in coding.  But there is, and it turns out they have numerous benefits. This "test" that I am talking about is not like literally compiling and running your code to see if it works right. Testing (or "unit testi...

A Console Chat Application in Java

For the past two weeks I've been studying how to use threads and sockets in Java. And as a practice of the stuff I learned, this week I made a very basic console chat application. The source code can be seen here. What I've made This chat application works by running two programs, a server program a...

Replicating the "cat" Command with Java

Hi, it's Yu again. Not you, it's me, Yu. I know right. It's such a confusing name. In the last article, I did a brief recap on the first month as an Intern. I've created a list of things I've done, but that was it. There wasn't much explanation on how and why I did those things, and the problems I'v...

How Networking Between a Client and a Server Works

When I started to work here I was creating a web server for learning, but I did't have a chance to complete it.  So recently, I started to work on it again to have a better understanding about the web. In this article, I'm going to right about how networking between a client and a server works. To s...

I Tried Real Hard to Think How Java Feels

You know what "import" is in Java, right? But how do they accurately choose the right classes to import in the first place? And how do they call the methods? Well if you were to call PrintTagbangers from a Main class, it should look something like this: Main.java package com.example.sample2; impo...

Naming Test Methods

If you're a programmer, at some point you should have faced the struggle of coming up with a good name for your classes, methods, and variables. You should have regretted looking back at your old code, thinking something like "how the hell did I come up with such a lame name?", or "I should've named...

Post-Redirect-Get Pattern in Spring MVC

These are examples that implement the Post-Redirect-Get pattern in Spring MVC. Code is also in GitHub. https://github.com/tagbangers/spring-best-practice... Pattern1: Not using the session package practice.post_redirect_get; import org.springframework.stereotype.Controller; import org.springframew...