Exceptions in Java

1. Overview

In this tutorial, we’ll learn about Java exceptions, why they occur, and how to handle them. Additionally, we’ll learn how to create custom exceptions.

2. Exceptions

The exceptions represent a problem that happens during program execution.  Read more

Read More

String Methods in Java

1. Overview

In this tutorial, we’ll learn about common methods from the String class and how to use them.

3. String Methods

The String represents a reference data type and consists of a set of characters.

Moreover, every character Read more

Read More

Working with String in Java

1. Overview

In this tutorial, we’ll learn how to work with String in Java.

2. String Class

String class is a class provided by the Java API. It’s placed inside java.lang package. This is a special package that doesn’t Read more

Read More

Exercise 1 – Objects and Classes

Requirements

Potrebno je kreirati klasu AnimalType koje ima sljedeće atribute:

  • name (String)

Atributima je potrebno postaviti privatno pravo pristupa (private) te definirati get i set metode koje će dohvaćati odnosno postavljati vrijednost atributima.

Kreirati konstruktor koji će Read more

Read More