Search This Blog

Sunday, June 27, 2021

Most common Core Java Interview Questions

1) What is the difference between an Abstract class and an Interface?

1. Abstract classes may have some executable methods and methods left unimplemented. Interfaces contain no implementation code.

2. An class can implement any number of interfaces, but subclass at most one abstract class.

3. An abstract class can have nonabstract methods. All methods of an interface are abstract.

4. An abstract class can have instance variables. An interface cannot.

5. An abstract class can define the constructor. An interface cannot.

6. An abstract class can have any visibility: public, protected, private or none (package). An interface's visibility must be public or none (package).

7. An abstract class inherits from Object and includes methods such as clone() and equals().


2) What are checked and unchecked exceptions?

Java defines two kinds of exceptions :

• Checked exceptions: Exceptions that inherit from the Exception class are checked exceptions. Client code has to handle the checked exceptions thrown by the API, either in a catch clause or by forwarding it outward with the throws clause. Examples - SQLException, IOException.

• Unchecked exceptions: RuntimeException also extends from Exception. However, all of the exceptions that inherit from RuntimeException get special treatment. There is no requirement for the client code to deal with them, and hence they are called unchecked exceptions. Example Unchecked exceptions are NullPointerException, OutOfMemoryError, DivideByZeroException typically,programming errors.


3) What is the difference between C++ & Java?

Well as Bjarne Stroustrup says "..despite the syntactic similarities, C++ and Java are very different languages. In many ways, Java seems closer to Smalltalk than to C++..". 

Here are a few I discovered:

• Java is multithreaded

• Java has no pointers

• Java has automatic memory management (garbage collection)

• Java is platform-independent (Stroustrup may differ by saying "Java is a platform"

• Java has built-in support for comment documentation

• Java has no operator overloading

• Java doesn’t provide multiple inheritance.

• There are no destructors in Java


4) What are the statements in JAVA?

Statements are equivalent to sentences in natural languages. A statement forms a complete unit of execution. The following types of expressions can be made into a statement by terminating the expression with a semicolon

• Assignment expressions

• Any use of ++ or --

• Method calls

• Object creation expressions

These kinds of statements are called expression statements. In addition to these kinds of expression statements, there are two other kinds of statements. A declaration statement declares a variable. A control flow statement regulates the order in which statements get executed. The for loop and the if statement are both examples of control flow statements.


5) What is the JAR file?

JavaARchive files are a big glob of Java classes, images, audio, etc., compressed to make one simple, smaller file to ease Applet downloading. Normally when a browser encounters an applet, it goes and downloads all the files, images, audio, used by the Applet separately. This can lead to slower downloads.

Tuesday, June 22, 2021

Roadmap of Full Stack Java Developer

Get started with the Full Stack Java Developer and explore everything about the full stack java developer.

There are a whole lot of technologies to learn and not all of them can be java based. At the very least, you will have to learn There are a whole lot of technologies to learn, and not all of it can be java based. At the very least, you will have to learn full-stack java development every beginner learns Core Java, Spring, Hibernate, Spring Boot, Microservices, SQL.

Becoming a full-stack developer seems an intimidating task, especially if you are completely new to the field of coding. As a beginner, you might think that you have a whole lot to learn within a short span of time. The languages, frameworks, libraries, and databases along with everything else required.

Phase-1: Implement OOPS using JAVA with Data Structures and Beyond

Brush up on your knowledge of software development fundamentals, Agile and Scrum methodologies, Java and data structures, GIT to manage version control systems, and Maven to manage project dependencies.

Phase-2: Become a back-end expert

Familiarize yourself with the back-end technologies by implementing knowledge of SQL, Java Servlets, and relational database ORM with Hibernate. Learn to connect databases with JDBC and work with RESTful web services.

Phase-3: Implement Frameworks the DevOps way

Master UI skills with advanced HTML and CSS and build 3-tier applications with Spring framework, Angular, JUnit5, SOAP. This phase will enable you to deploy continuous integration and automation using a common DevOps tool: Jenkins.

Phase-4: Develop a Web Application using frontend stack

Build real-world websites and applications using the front-end stack technologies such as HTML, CSS, JavaScript, and Angular. Handle diverse data types and manage your applications efficiently using MongoDB.

Phase-5: Testing in a DevOps Lifecycle

Begin automation testing and integration with Selenium Webdriver. Create seamless development and production environments using containerization with Docker and manage applications on Amazon S3 servers.

Full Stack Java Developer Capstone project provides you with hands-on working experience, the objective being to develop the entire application from scratch and deploy it into a pseudo-production environment.

Advantages:-

The advantage of being a full-stack developer is:

You can master all the techniques involved in a development project.

You can make a prototype very rapidly.

You can provide help to all the team members.

You can reduce the cost of the project.

You can reduce the time used for team communication.

You can switch between front and back-end development based on requirements.

You can better understand all aspects of new and upcoming technologies.