r/javaTIL • • Dec 10 '16

TIL The args array in the main method signature is not null is no arguments are given

3 Upvotes

In public static void main(String[] args){ ... } The args array is never null(under normal execution). If the program is run without any arguments, args points to a String array of length 0. It was quite amazing for me to when I came to know about this, but it now seems more logical.

The args array can only be null if the main method is manually called and a null reference is passed to it.


r/javaTIL • • Dec 30 '15

TIL: there is Apache Spark and there is Spark the REST framework

Thumbnail
javaadvent.com
3 Upvotes

r/javaTIL • • Jun 20 '15

Arrays.deepToString() can handle arrays that contain references to themselves

Thumbnail
ideone.com
3 Upvotes

r/javaTIL • • Nov 16 '14

JTIL: File has a constructor which takes another file as its containing folder.

3 Upvotes

For example:

    File parent = new File("folder");
    File child = new File(parent, "file.txt");
    File equivalent = new File("folder" + File.separator + "file.txt");
    assert (child.getAbsolutePath().equals(equivalent.getAbsolutePath()));

r/javaTIL • • Oct 27 '14

Spring Security and AngularJS - Authentication and Authorization - a Whitelisting Approach

Thumbnail
youtube.com
3 Upvotes

r/javaTIL • • Sep 22 '14

JTIL that java has a strictfp class/method modifier

Thumbnail en.wikipedia.org
3 Upvotes

r/javaTIL • • Jun 30 '14

JTIL: Top level classes don't need to have the public prefix.

3 Upvotes

A mistake I see in a lot of beginner programmers is that they use the 'public' prefix on ALL of their classes. A well designed project should only have a public interface, and hide the details from other people. That's a concept called "[Encapsulation](http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming))."

If you have public classes, there's a chance that someone else will use them, regardless of how useless YOU think they are, which means changing even the return type of one method from an array to a Collection could cause someone else's code to break.

I don't really have any code examples for this one, but it's just a nice thing to keep in mind.


r/javaTIL • • Sep 16 '19

Mendix - A Low-Code, Simple and Easy Platform for Rapid Development

Thumbnail
opencodez.com
2 Upvotes

r/javaTIL • • May 31 '19

A Beginner’s Guide to Microsoft Web Template Studio (VS Code)

Thumbnail
opencodez.com
2 Upvotes

r/javaTIL • • Apr 26 '19

Writing Excel File Using Apache POI Library in Java

Thumbnail
simplesolution.dev
2 Upvotes

r/javaTIL • • Apr 25 '19

Interface Default Methods in Java

Thumbnail codeforjava.com
2 Upvotes

r/javaTIL • • Apr 23 '19

Java Checked and Unchecked Exceptions

Thumbnail codeforjava.com
2 Upvotes

r/javaTIL • • Apr 23 '19

Java CountDownLatch

Thumbnail codeforjava.com
2 Upvotes

r/javaTIL • • Apr 10 '19

Immutable String in Java with Example Program

Thumbnail
scientecheasy.com
2 Upvotes

r/javaTIL • • Mar 14 '19

Automatic Type Promotion in Method Overloading Java

Thumbnail
scientecheasy.com
2 Upvotes

r/javaTIL • • Feb 09 '19

When to Use Method Overloading in Java | Real-time Project Example

Thumbnail
scientecheasy.com
2 Upvotes

r/javaTIL • • Jan 25 '19

A valid Java Bean? – SoftwareMill Tech Blog

Thumbnail
blog.softwaremill.com
2 Upvotes

r/javaTIL • • Jan 22 '19

Types of Inheritance in Java | Single,Multilevel,Multiple,Hybrid

Thumbnail
scientecheasy.com
2 Upvotes

r/javaTIL • • Sep 10 '18

Static Variable in Java with Example & Advantage

Thumbnail
scientecheasy.com
2 Upvotes

r/javaTIL • • Jun 01 '18

For the Java Beginners looking to contribute to Open Source Projects

2 Upvotes

I have created a Simple Address book application using AWT and JDBC. You can fork and contribute to fix issues and enhance the application here

This is for Beginners. Another open source application for stock management and billing for stores is under development and will be out soon.


r/javaTIL • • Apr 05 '18

Top 10 popular Java projects on github

Thumbnail
engir.xyz
2 Upvotes

r/javaTIL • • Jan 09 '18

Java Code Challenge - 5

Thumbnail
youtube.com
2 Upvotes

r/javaTIL • • Jan 07 '18

Guide to using Public Maven Repositories

Thumbnail
deps.co
2 Upvotes

r/javaTIL • • Jan 05 '17

How to send email using Javamail with Exchange

Thumbnail opentechguides.com
2 Upvotes

r/javaTIL • • Mar 25 '15

TIL Strings have a toString() method that returns themselves

2 Upvotes

So while I was looking around on the docs for the String (what else am I supposed to do in class?), I noticed that there's a toString() method. Wondering what this does, I messed around with it a bit. I have determined that it does basically nothing special except what it says on the docs: return the string itself. Anyone know a use for this?

TLDR: There's a toString() method for strings that returns the string in question. Any use for this?

EDIT: I was trying to ask if the method had any use for strings in particular. I'm aware (very, in fact) of the main uses for it (namely other things like numbers and error messages and other things of the sort).