Write a java program that creates Singly Link List to perform create, insert, delete and display node using menu driven program.
JAVA-7 Q.7 Write a java program that creates Singly Link List to perform create, insert, delete and display nodeusing menu driven program. Solution :-Â import java.util.Scanner; class Node { int data; Node next; public Node(int data) { this.data = data; this.next = null; } } class SinglyLinkedList { private Node head; public void create(int data) […]
Write a java program to design a class Mystring having data member of type String add member function to achieve following task.
JAVA-6 Q.6 Write a java program to design a class Mystring having data member of type String add memberfunction to achieve following task. Solution :-Â import java.util.Scanner; class MyString { private String str; public MyString(String str) { this.str = str; } // Method to reverse the string public String reverseString() { return new StringBuilder(str).reverse().toString(); } […]
Write a java program to create a player history that can be display in the following form.
JAVA-5 Q.5 Write a java program to create a player history that can be display in the following form.Player name and team name is stored in Player class. Score of test match and One Day match in theother class say Run class number of One Day match and number of test match must be in […]
Write an application that execute two Threads. One thread display “BCA” every 1000 milliseconds and the order displays “MCA” every 3000 milliseconds. Create the threads by extending the thread class.
JAVA-4 Q.4 Write an application that execute two Threads. One thread display “BCA” every 1000 milliseconds and the order displays “MCA” every 3000 milliseconds. Create the threads by extending the thread class. Solution :-Â class BCAThread extends Thread { public void run() { try { while (true) { System.out.println(“BCA”); Thread.sleep(1000); // 1000 milliseconds = 1 […]
Write a java program to. create and display Singly linked list and perform following task.
JAVA-3 ASSIGNMENT Q.3 Write a java program to. create and display Singly linked list and perform following task. Insert node at specific position. Delete node from specific position. Solution :- import java.util.Scanner; class Node { int data; Node next; public Node(int data) { this.data = data; this.next = null; } } class SinglyLinkedList { private […]
Write a java program to create EMPLOYEE class with name, age and salary data members. Take input (data) from user and create minimum 5 objects of employee class. Display all employees data in ascending order of salary.
JAVA-2 Q.2 Write a java program to create EMPLOYEE class with name, age and salary data members. Take input (data) from user and create minimum 5 objects of employee class. Display all employees data in ascending order of salary. Solution :-Â Â import java.util.*; class Employee implements Comparable { String name; int age; double salary; // […]
Write a java program to enter strings at command line input and then sort strings into ascending order.
JAVA Q.1 Write a java program to enter strings at command line input and then sort strings into ascending order. import java.util.Arrays; public class SortStrings { public static void main(String[] args) { // Check if there are any command-line arguments if (args.length == 0) { System.out.println(“Please enter strings as command-line arguments.”); return; } // Sort […]
Unit-5: Cursors and Exception Handling:
Cursors and Exception Handling: Cursors and Exception Handling: 5.1 Concepts of Cursors 5.1.1 Types of cursors (Implicit & Explicit ) 5.1.2 Declare, open, fetch and close cursors. 5.2 Cursor Attributes : (%FOUND,%NOTFOUND,%ISOPEN,%ROWCOUNT) 5.3 Exception Handling in PL/SQL 5.3.1 Types of Exceptions: 5.3.1.1 Named System Exceptions 5.3.1.2 Unnamed System Exceptions 5.3.1.3 User-defined Exceptions 5.3.1.4 User Defined […]
Unit-4 : Iterative Statements
Unit-4 : Iterative Statements Unit-4 : Iterative Statements 4.1 Iterative statements : 4.1.1 Loop..End Loop 4.1.2 For.. Loop 4.1.3 While Loop 4.1.4 EXIT Loop 4.1.5 Continue Iterative Statements in PL/SQL. Introduction. Iterative statements in PL/SQL allow a set of statements to be executed repeatedly based on a condition. These loops help in automating repetitive tasks, […]