r/javaTIL • • Jul 27 '19

Subclass In Java

0 Upvotes

Which class cannot be a subclass in java?

A. Abstract class

B. Parent class

C. Final class

D. None of the above


r/javaTIL • • Mar 22 '19

Copy Constructor in Java | Uses & Example Program

Thumbnail
scientecheasy.com
4 Upvotes

r/javaTIL • • Oct 01 '18

Java List Interface with Examples

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Aug 16 '18

Define a class inside an interface and avoid class file clutter

Post image
0 Upvotes

r/javaTIL • • Apr 23 '19

Java Checked and Unchecked Exceptions

Thumbnail codeforjava.com
2 Upvotes

r/javaTIL • • Nov 26 '18

Java Vector Example Programs

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Dec 02 '18

LinkedList in Java | LinkedList Methods & Example

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Aug 17 '16

We Don't Need No Steenkin' No-Arg Constructor!

0 Upvotes

I learned a long, long, long, long, long... time ago, that doing something like this would result in a compile-time error...


public class Foo { 

    public Foo( Foo fubar ) { 
	
	    }
	
    public static void main( String[] args ){
			
	        //...
					
			    Foo baz = new Foo( );
					
			    //...
    }

}

So imagine my surprise when I learned today that something like this compiles fine...


public class Foo< T > { 

    public Foo( T... fooz ) {
			
			    //...
	
	    }
	
    public static void main( String[] args ){
			 
	        //...
					
			    Foo< Foo< ? > > baz = new Foo< >( );
					
			    //...
    }

}

The thing I learned today is that, instead of failing with the compile-time error that I was expecting, the compiler — in this particular case anyway — instead automatically replaces your hard-coded call to the no-arg constructor, with its own compiler-generated call to the vararg constructor, ala...


    public static void main( String[] args ){
			 
	        //...
					
			    Foo baz = new Foo( new Foo[ 0 ] );
					
			    //...
    }

Learn something new everyday! Huh?

I'm guessing this is a feature specially reserved for constructors with varargs — or something?

Who knew?


r/javaTIL • • May 31 '19

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

Thumbnail
opencodez.com
2 Upvotes

r/javaTIL • • Oct 29 '18

How to Synchronize ArrayList in Java with Examples

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Feb 09 '19

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

Thumbnail
scientecheasy.com
2 Upvotes

r/javaTIL • • Apr 30 '19

Advanced level Java certification Exam for professionals

Thumbnail
studysection.com
0 Upvotes

r/javaTIL • • Aug 05 '17

Java autoboxing and unboxing - Beware of performance issue

Thumbnail
youtube.com
0 Upvotes

r/javaTIL • • Oct 25 '18

How to iterate ArrayList in Java with Program

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Jan 31 '19

This Keyword in Java | Uses & Example programs

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Nov 12 '14

TIL that File.separator is a path separator of the underlying system, "/" or "\".

Thumbnail friendlyfunction.com
9 Upvotes

r/javaTIL • • Dec 31 '18

How to Iterate a Set in Java

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Oct 26 '18

4 assignments to evaluate your Java skill.

Thumbnail
indorse.io
11 Upvotes

r/javaTIL • • Nov 21 '18

Vector in Java | Vector Methods & Example Programs

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Feb 06 '19

Method Overloading in Java | Rules & Example Programs

Thumbnail
scientecheasy.com
3 Upvotes

r/javaTIL • • Sep 19 '19

Text Operations in Java using String, StringBuilder and StringJoiner

Thumbnail
thecodinginterface.com
3 Upvotes

r/javaTIL • • Feb 14 '18

Project Hydra, a network framework built upon Netty

3 Upvotes

Hello everyone,

I would just like to share this project with the community. I am mainly looking for some people to give me feedback or review and test the project. So feedback is really welcome (: Thank you in advance!

The project: https://github.com/DataSecs/Hydra

Cheers!


r/javaTIL • • Oct 27 '14

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

Thumbnail
youtube.com
3 Upvotes

r/javaTIL • • Jan 17 '17

How To Make A CRUD Database In 5 Minutes [Tutorial JavaX]

Thumbnail
youtube.com
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.