Introduction to Java: Exceptions

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. If we 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

Introduction to Java: Working with String

The String is one of the most used classes in Java programming language.

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

1. The String Class

String class is a class provided by the Java API. 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
String

String Zadaci za Vježbu

U nastavku možeš pronaći jednostavne zadatke koji će ti pomoći prilikom savladavanja gradiva vezanog uz String klasu u Javi.

Zadatak 1

Potrebno je napisati Java program koji će učitavati brojčane vrijednosti od strane korisnika dokle god korisnik ne unese Read more

Read More