Java Tutorials

quiz on java basics for beginners 5

Quiz on Java Basics for Beginners

Are you eager to test your grasp of Java fundamentals? This interactive quiz is designed specifically for beginners, offering a fun and effective way to assess your understanding of core Java concepts. Whether you’re...

Java Program For Abstract Class and Abstract Method 0

Java Program For Abstract Class and Abstract Method

Program 1 /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package abstractpack; abstract class MyButton { abstract void click(); abstract void dbclick(); } Program 2 /*...

Java Program For Has-A Relation 0

Java Program For Has-A Relation

Program 1 package emp; public class EmpInfo { PersonalInfo P; int empid; String DeptName; int Salary; public EmpInfo(PersonalInfo P, int empid, String DeptName, int Salary) { this.P = P; this.empid = empid; this.DeptName =...

Java Program For this Keyword 0

Java Program For this Keyword

Program 1 package testcoreproject; class Employee { //Instance variable private int id; private String name; private String dept; Employee(int id,String name,String dept) // Local variable { this.id=id; this.name=name; this.dept=dept; } void display() { System.out.println(“ID...

Java Program For Static Keyword Execution 0

Java Program For Static Keyword Execution

Program 1 //static variable package testcoreproject; public class Abc { static int count=0; Abc() { count++; } void display() { System.out.println(“Total Object Created: “+count); } } Program 2 package testcoreproject; public class Abc1 {...

Java Program For final Keyword 0

Java Program For final Keyword

Program 1 package testcoreproject; import java.awt.*; class Base1 { public static final float PI=3.14f; int factorial(int n) { int f=1; while(n!=0) { f=f*n; n–; } return f; } } class Derived1 extends Base1 {...

Java Program For super and this Keyword 0

Java Program For super and this Keyword

Program 1 package testcoreproject; class Student { int rno; String name; int per; Student(int rno,String name,int per) { this.rno=rno; this.name=name; this.per=per; } } class First1 { int m=100; // super class data void display()...