DEV Community

vimal krush
vimal krush

Posted on

Java day -2

Basic errors for in java:

There are three types of errors in Java: syntax errors, runtime errors, and logical errors.

1) Syntax errors occur when the code doesn't follow the rules of the Java language.

2) Runtime errors occur during the execution of the program and can be caused by things like division by zero or trying to access an element of an array that doesn't exist.

3) Logical errors occur when the program runs without any errors, but it doesn't produce the expected

how to resolve above errors:

1) solve syntax error in java: capitalize keywords, rather than use lowercase.

2) To resolve a runtime error: first identify the error message and its context, then check for logical, mathematical, or typographical errors in the code, ensure proper data types and variable initialization, and consult documentation if necessary.

3) solve logical error in java: use debugging tools, print statements, and break down the problem into smaller parts, testing each part separately

class Vs objects in java

Image description

Basic understanding of OOPs
Image description

Errors oocurs in basic programm:

Image description

Resolve:
1-public void main converting into public static void main
2- space between the args
Ex:
(String[] args)
3- system.Out.println this method contain capital S
4- final bug fix in this program is command line ends with semicolon.
Ex:
(welcome to java programming)~(Welcome to java programming);
|----|
"Here are some conflitcs to resolve "

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay