How to install Java on Ubuntu
godarda@gd:~$ sudo apt -y install openjdk-21-jre openjdk-21-jdk ... root@gd:/home/godarda# java --version openjdk 21.0.5 2024-10-15 OpenJDK Runtime Environment (build 21.0.5+11-Ubuntu-1ubuntu124.04) OpenJDK 64-Bit Server VM (build 21.0.5+11-Ubuntu-1ubuntu124.04, mixed mode, sharing)
Java Fundamentals
Java Hello World programJava Hello World program without using a semicolonJava program to perform the arithmetic operationsJava program to perform the boolean operationsShow More »Java Control Statements
Java program to check the equality of given numbersJava program to check the given number is positive or negativeJava program to check the given number is even or oddJava Loops
Java program to print the even and odd numbersJava program to print the numbers using for loopJava program to print the star pyramid patternsJava program to find the factorial of a given numberJava Strings
Java program to concatenate the given stringsJava implementation of the indexOf methodJava implementation of the Character classJava implementation of the charAt methodShow More »Java Arrays
Java program to print the sum of all numbers in a given arrayJava program to find the min and max number from a given arrayJava program to print the length of all strings from a given arrayJava program to print the transpose of a given matrixJava Classes
Java program to demonstrate the use of Math class methodsJava program to demonstrate the use of constructorJava implementation of final and static keywordsJava implementation of Scanner close methodShow More »Java Methods
Java program to get the Operating System detailsHow to get the size of heap in JavaJava program to format the text blocks strings using formatted() methodJava Inheritance
Java program for Single InheritanceJava program for Multilevel InheritanceJava program for Hierarchical InheritanceJava program for Hybrid Inheritance (Multilevel and Hierarchical)Java Polymorphism
Implementation of Java method overloadingHow to overload the main() method in JavaImplementation of Java method overridingJava Abstraction
Java program for Abstract classJava program for InterfaceHow to achieve multiple inheritance in Java using interfacesHow to achieve multiple inheritance in Java using interfaces and default methodsJava Collections
Implementation of Java ArrayList classImplementation of Java LinkedList classImplementation of Java HashSet classImplementation of Java LinkedHashSet classShow More »Java Exception Handling
Java program to demonstrate the use of try and catch blocksJava program to demonstrate the use of finally blockJava program to demonstrate the use of nested try, catch, and finally blocksJava program to handle the ArithmeticExceptionShow More »Java Regular Expressions
Implementation of Java Regular ExpressionsJava program to accept a valid blood group using regexJava Multithreading
Java program to extends the Thread classJava program for Runnable interfaceJava program for getName(), getId() and getPriority() methodsJava program for join() and sleep() methodsShow More »Java AWT and Swing Graphics
Java program to draw a Line using Graphics2D classJava program to draw a Curve using Graphics2D classJava program to draw a Circle using Graphics2D classJava program to draw a Rectangle using Graphics2D classShow More »Java Database Connectivity (JDBC)
Java MySQL to connect, create database, and tableJava MySQL to insert and retrieve the records from a tableJava MySQL to update the table recordsJava MySQL to perform JDBC CRUD operationsShow More »Advertisement