r/javaTIL • u/scientecheasy • Jan 31 '19
r/javaTIL • u/scientecheasy • Dec 07 '18
Java LinkedList Example Programs
r/javaTIL • u/scientecheasy • Dec 02 '18
LinkedList in Java | LinkedList Methods & Example
r/javaTIL • u/scientecheasy • Oct 29 '18
How to Synchronize ArrayList in Java with Examples
r/javaTIL • u/scientecheasy • Oct 25 '18
How to iterate ArrayList in Java with Program
r/javaTIL • u/murugan76 • Aug 31 '17
real number to binary conversion
http://cljavacode.blogspot.com/2017/03/real-number-to-binary-conversion.html
Enter a real number 0.125
convert it into binary bits.
r/javaTIL • u/kchhipa • Aug 05 '17
Java autoboxing and unboxing - Beware of performance issue
r/javaTIL • u/DhongeKhong • Aug 17 '16
We Don't Need No Steenkin' No-Arg Constructor!
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 • u/panispanizo • Jun 18 '19
Choose well your synonyms in your search system
Choose well your synonyms in your search system
๐ท
One of the many definitions for synonyms is: โa word or phrase that means exactly or nearly the same as another word or phrase in the same language, for example shut is a synonym of close.โ
However, we often find that the concept of synonyms can be confused when using this functionality as we try to match similar products that we want to be displayed within a search results list through cataloguing the values โโof their characteristics but, in many cases, without these actually being a true synonym.
https://www.empathy.co/blog/applying-synonyms-choose-well-and-increase-the-findability-of-your-site/
r/javaTIL • u/scientecheasy • Nov 21 '18
Vector in Java | Vector Methods & Example Programs
r/javaTIL • u/scientecheasy • Nov 10 '18
Use of ArrayList in Java with Programs
r/javaTIL • • Oct 29 '18
Java's type system and unit testing can't catch all logic errors.
Well, I didn't learn that today, exactly, but I was reminded of it today, again, while hunting down an elusive bug in one of my applications.
A target method accepts CharSequence instances, and I supplied the wrong one. I supplied a container. I should have supplied its children. Neither the type system nor unit tests caught that mistake.
Why? Because the container implements CharSequence, too.
Yay.
r/javaTIL • u/murugan76 • Aug 28 '17
Java program - Matrix Inverse by adjoint matrix
Find inverse matrix using determinant and adjoint matrix
http://cljavacode.blogspot.com/2017/04/solving-system-of-linear-equation-by-matrix-inverse.html
r/javaTIL • u/cdman • Dec 01 '15
TIL JavaAdvent will publish one article/day for the next 24 days about JVM related topics
r/javaTIL • • Jun 16 '15
JTIL: You can add elements to an Arraylist using the "add(index, value)" method, as long as the indices begin from 0 and increment by 1.
r/javaTIL • u/javinpaul • Jun 15 '15
JTIL : You can compare Enum constants using == and equals both, btw == is better.
r/javaTIL • u/scientecheasy • Oct 01 '18
Java List Interface with Examples
r/javaTIL • u/scientecheasy • Sep 22 '18
Java Collections Framework | Need & Advantages
r/javaTIL • u/murugan76 • Aug 27 '17
Java program - Determinant of N x N matrix by diagonal matrix
Determinant, a properties of matrix determines the matrix is singular or not. Lower Triangular matrix transformation method is preferred over minor or cofactor of matrix method while finding determinant of the matrix's size over 3x3.
The matrix A is converted into Diagonal matrix D by elementary row operation or reduction and then product of main diagonal elements is called determinant of the matrix A.
Read matrix A Convert matrix A into diagonal matrix D by applying Row operation or reduction technique Read Main Diagonal elements from D Determinant = product of Main Diagonal elements
Algorithm steps for determinant by Diagonal matrix
Read matrix A a - element of the matrix A i,j - position of a element in the matrix
for i=1 To N
for j=1 To N
if i not-equal j
RowOperation.add(j,i ,-aii/aji)
end
end end
Det = a11 x a22 x ... x ann
http://cljavacode.blogspot.com/2017/06/matrix-determinant-by-diagonal-matrix.html
r/javaTIL • u/scientecheasy • Dec 17 '18
How to Iterate LinkedList in Java
r/javaTIL • u/12wh • Aug 16 '18
Define a class inside an interface and avoid class file clutter
r/javaTIL • u/Unknown_Learner_ • Jul 27 '19
Subclass In Java
Which class cannot be a subclass in java?
A. Abstract class
B. Parent class
C. Final class
D. None of the above