How to remove duplicate elements from a list using java8 and sort
example:- "abc","abc","xyz","pqr","pqr" output:- "abc","pqr","xyz".
what are the status of the object in case of java hibernate :- persistent , transient
What are the memory blocks in case of stack
What is the optional class
Why do we require only one abstract method in case of functional interface ?
How do we use functional interface with lambda expression
What is actuator ?
what is indexing in database
How do you write junit for the method which does not return any thing
How many types of executor service ? what are their implementation
what is cyclic barrier and count down latch ?
What is cascading in hibernate with an example
what is transaction management in hibernate
can immutable class be singleton and vice versa ?
What is solid principal in java ?
what is atomicity?
what are the scopes of spring bean?
What is inversion of control
https://dzone.com/articles/50-java-interview-questions-for-programmers
try with resources :- https://www.journaldev.com/592/java-try-with-resources
what is try with multi catch :- https://www.journaldev.com/629/java-catch-multiple-exceptions-rethrow-exception
https://www.journaldev.com/2752/java-8-interface-changes-static-method-default-method
What is generic class and wrapper class
How to sort a collection of custom Objects in Java?
What is inner class in java?
We can define a class inside a class and they are called nested classes. Any non-static nested class is known as an inner class. Inner classes are associated with the object of the class and they can access all the variables and methods of the outer class. Since inner classes are associated with the instance, we can’t have any static variables in them.
We can have local inner class or anonymous inner class inside a class. For more details read java inner class.
What is anonymous inner class?
A local inner class without a name is known as an anonymous inner class. An anonymous class is defined and instantiated in a single statement. Anonymous inner class always extend a class or implement an interface.
Since an anonymous class has no name, it is not possible to define a constructor for an anonymous class. Anonymous inner classes are accessible only at the point where it is defined.
What is ternary operator in java?
Java ternary operator is the only conditional operator that takes three operands. It’s a one liner replacement for if-then-else statement and used a lot in java programming. We can use ternary operator if-else conditions or even switch conditions using nested ternary operators. An example can be found at java ternary operator.
- Difference between jar and war
What is the use of System class?
Java System Class is one of the core classes. One of the easiest ways to log information for debugging is System.out.print() method.
System class is final so that we can’t subclass and override its behavior through inheritance. System class doesn’t provide any public constructors, so we can’t instantiate this class and that’s why all of its methods are static.
Some of the utility methods of System class are for array copy, get the current time, reading environment variables. Read more at Java System Class.
Comments
Post a Comment