Core Java Bullet points………

What is the difference between path and classpath variables?

The path is an environment variable which is used by operating systems

Classpath is very specific to Java and used for locating .class files by java executables

What is the final Keyword in Java?

Answer: Final keyword is used with the class to make sure that any other class can’t extend it. For example String class is final and we can‘t extend it

What is the volatile keyword in Java?

Answer: Volatile keyword in Java is used with variables and all the threads read its value directly from the memory location and don’t cache it. Volatile keyword makes sure that the read value is exactly the same as in the memory location.

What happens when an exception is thrown by the main method?

Answer: When the main0 method throws out an exception then the Java Runtime Environment terminates the program and the print the exception message which was stacked in system console.

IS-A relationship based on Inheritance, which can be of two types Class Inheritance or Interface Inheritance.

Has-a relationship is composition relationship which is a productive way of code reuse.

Difference between Constructor and Method

The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code.

Constructors cannot be abstract, final, static and synchronised while methods can be.

Constructors do not have return types while methods do

Main method declaration in Java

public static void main(String[] args)
you can use modifier final ,synchronized ,strictfp

public final synchronized strictfp static void main(String args[])

Main method overloading

Difference b/w Hashset, LinkedHashSet and TreeSet

Wildcards in Java

The question mark (?) is known as the wildcard in generic programming .It represents an unknown type. The wildcard can be used in a variety of situations such as the type of a parameter, field, or local variable; sometimes as a return type

Types of wildcards in Java:

Upper Bounded Wildcards: These wildcards can be used when you want to relax the restrictions on a variable. For example, say you want to write a

public static void add(List<? extends Number> list)

Lower Bounded Wildcards: It is expressed using the wildcard character (‘?’), followed by the super keyword, followed by its lower bound: <? super

Collection type <? super A>

Multithreding

Solid principal

Java||Spring-Boot|| Micro services Application developer|| INDIA

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Git and Github Essentials

NFTify platform development sprint 2 demo video

The Bloom Post Processing Effect

C language developed by Denise Richie.

Entering into the world of coding [SpartaCodingClub #3]

Design Patterns: A Retrospective

Python auto switch between multiple browser tabs

AS3935: Arduino lightning datalogger

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sanjay Singh

Sanjay Singh

Java||Spring-Boot|| Micro services Application developer|| INDIA

More from Medium

Java for SDET/QA’s

Java 16 Records

Java Built-In Functional Interfaces

COLLECTIONS IN JAVA