CHAKRI
CHAKRI
BACHELOR OF TECHNOLOGY
IN
COMPUTERSCIENCE & ENGINEERING
Submitted by
PASAM CHAKRADHAR
22F91A0521
PRAKASAMENGINEERINGCOLLEGE
(An ISO 9001-2008&NAAC Accredited Institution)
A.Y:2024-2025
PRAKASAMENGINEERINGCOLLEGE
(AnISO9001-2008&NAACAccreditedInstitution)
O.V.ROAD,KANDUKUR-523105,A.P.
DEPARTMENTOF
COMPTERSCIENCE&ENGINEERING
BONAFIDECERTIFICATE
This is to certify that the Internship report entitled “JAVA PROGRAMMING” is a bonafide
Certificate of Completion
This is to certify Pasam Chakradhar
under of Prakasam Engineering College of JNTUK has
successfully completed 6 weeks Short -Term Internship on
Java Programming
Organized by ExcelR Edtech Pvt. Ltd. in collaboration with
Andhra Pradesh State Council of Higher Education
I am very grateful and my sincere thanks to our secretary & correspondent Dr.K.RAMAIAH of
PRAKASAM ENGINEERING COLLEGE for giving this opportunity.
I hereby, express my regards and extend my gratitude to our PRINCIPAL, Dr.CH. RAVI
KUMAR , for giving this opportunity to do the thesis as a part of our course.
I would like to thank Mr.RAM TAWA EXCELR PVT LTD,HYDERBAD for giving me the
opportunity to do an internship within the organization.
I would also like to thank all my Faculties in Prakasam Engineering College for their constant
encouragement and for being a great group of knowledgeable and cooperative people to work
with.
PASAM CHAKRADHAR
22F91A0521
Week 1: Introduction to Java Programming
- Brief history of the company, including its founding and major milestones.
- Key products and services offered, highlighting the company’s market position and
unique selling points.
- Names and roles of team members, including their areas of expertise and
responsibilities.
- Team structure and hierarchy, explaining how different departments and roles interact.
- Specific objectives for the internship, such as learning outcomes and skill development.
- Step-by-step guide to downloading and installing the JDK from the official Oracle
website.
- Overview of popular IDEs (IntelliJ IDEA, Eclipse, NetBeans), with a focus on the chosen
IDE for the internship.
- Detailed setup instructions for the chosen IDE, including installation and initial
configuration.
- Customizing IDE settings for optimal workflow, such as configuring code style, enabling
useful plugins, and setting up version control.
- Importance of environment variables in Java development, explaining how they affect the
compilation and execution of Java programs.
- Instructions for setting JAVA_HOME and PATH variables on different operating systems
(Windows, macOS, Linux).
- Detailed explanation of the program structure, including the `public class` declaration
and the `main` method.
- Compiling and running the program from the command line, with a focus on
understanding the compilation process and common errors.
- Syntax rules and conventions, including naming conventions, code indentation, and
comments.
- Using the `javac` compiler to compile Java source files, with examples of common
commands and options.
- Running Java applications with the `java` command, including passing arguments to the
`main` method.
- Overview of primitive data types (int, char, float, boolean, etc.), including their ranges
and default values.
- Declaring and initializing variables, with examples of different data types and
initialization methods.
- Type casting and type conversion, explaining the difference between implicit and explicit
casting with examples.
```java
System.out.println(“Age: “ + age);
System.out.println(“Grade: “ + grade);
System.out.println(“Salary: “ + salary);
```
- Relational operators, such as equality, inequality, greater than, and less than, with
examples of their use in conditional statements.
- Logical operators, including AND, OR, and NOT, with examples of combining logical
operators in complex expressions.
```java
```
- Looping statements, including `for`, `while`, and `do-while` loops, with examples of
iterative processes and common patterns.
```java
// If-else statement
If (number > 0) {
} else {
System.out.println(“The number is not positive.”);
// For loop
System.out.println(“For loop:”);
System.out.println(“i: “ + i);
// While loop
System.out.println(“While loop:”);
Int j = 0;
While (j < 5) {
System.out.println(“j: “ + j);
J++;
// Do-while loop
System.out.println(“Do-while loop:”);
Int k = 0;
Do {
System.out.println(“k: “ + k);
K++;
}
```
- **Introduction to OOP**
- Defining a class and creating objects, with examples of class definitions and object
instantiation.
- Constructors and methods, explaining their roles in initializing objects and defining
behavior.
```java
Class Student {
String name;
Int age;
Void display() {
System.out.println(“Name: “ + name);
System.out.println(“Age: “ + age);
Student1.name = “John”;
Student1.age = 20;
Student1.display();
```
- **Encapsulation**
- Access modifiers (private, public, protected), explaining their impact on visibility and
access control.
- Getters and setters, with examples of encapsulating fields and providing controlled
access.
```java
Class Person {
Return name;
This.name = name;
}
// Getter for age
Return age;
This.age = age;
Person.setName(“Alice”);
Person.setAge(30);
System.out.println(“Name: “ + person.getName());
System.out.println(“Age: “ + person.getAge());
```
- **Inheritance**
- Extending classes, explaining the concept of inheritance and the `extends` keyword.
// Base class
Class Animal {
Void eat() {
// Derived class
Void bark() {
```
- Method overriding, with a focus on runtime polymorphism and the use of the
`@Override` annotation.
```java
Class MathOperations {
// Method overloading
Return a + b;
Return a + b;
```
- **Abstraction**
- Abstract classes and methods, explaining their roles in defining abstract behavior and
providing partial implementation.
- Interfaces, explaining their use in defining contracts and enabling multiple inheritance.
```java
// Abstract class
// Concrete class
Void draw
___________________________________________
- Types of linked lists: singly linked list, doubly linked list, circular linked list.
```java
System.out.println(number);
Class Node {
Int data;
Node next;
Node(int data) {
This.data = data;
This.next = null;
Node head;
If (head == null) {
Head = newNode;
} else {
Temp = temp.next;
Temp.next = newNode;
System.out.print(temp.data + “ “);
Temp = temp.next;
List.insert(1);
List.insert(2);
List.insert(3);
List.display();
```
```java
Import java.util.Stack;
Public class StackExample {
Stack.push(1);
Stack.push(2);
Stack.push(3);
System.out.println(“Stack: “ + stack);
Stack.pop();
Import java.util.LinkedList;
Import java.util.Queue;
Queue.add(1);
Queue.add(2);
Queue.add(3);
System.out.println(“Queue: “ + queue);
Queue.remove();
```
#### Algorithms
- **Sorting Algorithms**
- Overview of common sorting algorithms: bubble sort, selection sort, insertion sort,
merge sort, quick sort.
```java
Int n = arr.length;
Arr[j + 1] = temp;
}
Public static void main(String[] args) {
bubbleSort(arr);
System.out.print(num + “ “);
```
- **Searching Algorithms**
```java
If (arr[i] == key) {
Return I;
Return -1;
}
Int key = 1;
If (result == -1) {
} else {
Int low = 0;
If (arr[mid] == key) {
Return mid;
Low = mid + 1;
} else {
High = mid – 1;
Return -1;
If (result == -1) {
} else {
```
- Debugging and testing code, explaining common debugging techniques and tools.
```java
Import java.util.ArrayList;
Import java.util.List;
Class Book {
This.title = title;
This.author = author;
This.isIssued = false;
Return title;
Return author;
}
Public boolean isIssued() {
Return isIssued;
isIssued = true;
isIssued = false;
Class Library {
Public Library() {
Books.add(book);
Book.issue();
Return;
Book.returnBook();
Return;
If (book.getTitle().equals(title)) {
Return;
}
}
Library.searchBook(“1984”);
Library.issueBook(“1984”);
Library.returnBook(“1984”);
```
- **Introduction to Exceptions**
- **Try-Catch Block**
```java
Try {
} catch (ArrayIndexOutOfBoundsException e) {
} finally {
```
- **Throw and Throws**
```java
} else {
```
```java
Import java.io.*;
// Writing to a file
Bw.write(“Hello, World!”);
} catch (IOException e) {
e.printStackTrace();
String line;
System.out.println(line);
} catch (IOException e) {
e.printStackTrace();
}
```
- **Introduction to Collections**
- Overview of the Collections Framework: List, Set, Map, and Queue interfaces.
- **List Interface**
```java
Import java.util.ArrayList;
Import java.util.List;
Fruits.add(“Apple”);
Fruits.add(“Banana”);
Fruits.add(“Orange”);
// Accessing elements
System.out.println(fruits.get(1)); // Output: Banana
// Removing an element
Fruits.remove(“Banana”);
System.out.println(fruit);
```
- **Set Interface**
```java
Import java.util.HashSet;
Import java.util.Set;
Animals.add(“Dog”);
Animals.add(“Cat”);
Animals.add(“Horse”);
// Removing an element
Animals.remove(“Cat”);
System.out.println(animal);
```
- **Map Interface**
```java
Import java.util.HashMap;
Import java.util.Map;
Ages.put(“Alice”, 30);
Ages.put(“Bob”, 25);
Ages.put(“Charlie”, 35);
// Accessing a value
System.out.println(ages.get(“Alice”)); // Output: 30
Ages.remove(“Bob”);
System.out.println(entry.getKey() + “: “ + entry.getValue());
```
- Writing programs to demonstrate the use of exception handling, file I/O, and collections.
- Debugging and testing code, explaining common debugging techniques and tools.
```java
Import java.util.ArrayList;
Import java.util.List;
Class Student {
This.name = name;
This.age = age;
This.id = id;
Return name;
Return age;
}
Public String getId() {
Return id;
@Override
Return “Student{“ +
“, age=” + age +
“, id=’” + id + ‘\’’ +
‘}’;
Class StudentManagementSystem {
Public StudentManagementSystem() {
Students.add(student);
If (student.getId().equals(id)) {
Students.remove(student);
Break;
System.out.println(student);
System.out.println(“All Students:”);
Sms.displayStudents();
System.out.println(“Updated Students:”);
Sms.displayStudents();
}
``
___________________________________________
```java
Import java.awt.*;
Import java.awt.event.*;
Public class AWTExample {
button.addActionListener(new ActionListener() {
System.out.println(“Name: “ + textField.getText());
});
Frame.add(label);
Frame.add(textField);
Frame.add(button);
Frame.setSize(400, 200);
Frame.setLayout(null);
Frame.setVisible(true);
}
```
```java
Import javax.swing.*;
Import java.awt.event.*;
button.addActionListener(new ActionListener() {
System.out.println(“Name: “ + textField.getText());
});
Frame.add(label);
Frame.add(textField);
Frame.add(button);
Frame.setSize(400, 200);
Frame.setLayout(null);
Frame.setVisible(true);
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
```
- **Introduction to Multithreading**
```java
T1.start();
T2.start();
```
```java
}
Public class RunnableExample {
T1.start();
T2.start();
```
- **Thread Synchronization**
```java
Class Counter {
Count++;
Return count;
}
Public class SynchronizationExample {
Counter.increment();
});
Counter.increment();
});
T1.start();
T2.start();
Try {
T1.join();
T2.join();
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println(“Count: “ + counter.getCount());
```
- Debugging and testing code, explaining common debugging techniques and tools.
- Implementing functionalities like sending and receiving messages, and displaying chat
history.
```java
Import javax.swing.*;
Import java.awt.event.*;
Import java.awt.*;
Import java.util.ArrayList;
Class ChatWindow extends JFrame {
Public ChatWindow() {
chatArea.setEditable(false);
sendButton.addActionListener(new ActionListener() {
chatHistory.add(message);
inputField.setText(“”);
});
Add(chatArea);
Add(inputField);
Add(sendButton);
setSize(400, 300);
setLayout(null);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
New ChatWindow();
```
```java
// Server Program
Import java.io.*;
Import java.net.*;
System.out.println(“Client connected”);
System.out.println(“Received: “ + message);
Socket.close();
Ex.printStackTrace();
// Client Program
Import java.io.*;
Import java.net.*;
Writer.println(“Hello, Server!”);
Socket.close();
```
- **Introduction to JDBC**
- **Connecting to a Database**
```java
Import java.sql.*;
While (resultSet.next()) {
} catch (SQLException e) {
e.printStackTrace();
```
- **Introduction to JavaFX**
```java
Import javafx.application.Application;
Import javafx.scene.Scene;
Import javafx.scene.control.Button;
Import javafx.scene.layout.StackPane;
Import javafx.stage.Stage;
@Override
Root.getChildren().add(button);
primaryStage.setTitle(“JavaFX Example”);
primaryStage.setScene(scene);
primaryStage.show();
Launch(args);
```
#### Practical Exercises and Mini-Project
- Debugging and testing code, explaining common debugging techniques and tools.
- Implementing functionalities like browsing books, adding books to the cart, and checking
out.
```java
Import javafx.application.Application;
Import javafx.scene.Scene;
Import javafx.scene.control.Button;
Import javafx.scene.control.ListView;
Import javafx.scene.layout.VBox;
Import javafx.stage.Stage;
Import java.sql.*;
Import java.util.ArrayList;
Import java.util.List;
Class Book {
This.title = title;
This.author = author;
@Override
@Override
primaryStage.setTitle(“Online Bookstore”);
primaryStage.setScene(scene);
primaryStage.show();
Books.clear();
While (resultSet.next()) {
listView.getItems().setAll(books);
} catch (SQLException e) {
e.printStackTrace();
}
Public static void main(String[] args) {
Launch(args);
```
```java
// Server Program
Import java.io.*;
Import java.net.*;
System.out.println(“Client connected”);
System.out.println(“Received: “ + message);
Socket.close();
Ex.printStackTrace();
// Client Program
Import java.io.*;
Import java.net.*;
Public class Client {
Writer.println(“Hello, Server!”);
Socket.close();
```
- **Introduction to JDBC**
- **Connecting to a Database**
```java
Import java.sql.*;
While (resultSet.next()) {
} catch (SQLException e) {
e.printStackTrace();
```
#### JavaFX for GUI Development
- **Introduction to JavaFX**
```java
Import javafx.application.Application;
Import javafx.scene.Scene;
Import javafx.scene.control.Button;
Import javafx.scene.layout.StackPane;
Import javafx.stage.Stage;
@Override
Root.getChildren().add(button);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle(“JavaFX Example”);
primaryStage.setScene(scene);
primaryStage.show();
Launch(args);
```
- Debugging and testing code, explaining common debugging techniques and tools.
- Implementing functionalities like browsing books, adding books to the cart, and checking
out.
```java
Import javafx.application.Application;
Import javafx.scene.Scene;
Import javafx.scene.control.Button;
Import javafx.scene.control.ListView;
Import javafx.scene.layout.VBox;
Import javafx.stage.Stage;
Import java.sql.*;
Import java.util.ArrayList;
Import java.util.List;
Class Book {
This.title = title;
This.author = author;
@Override
primaryStage.setTitle(“Online Bookstore”);
primaryStage.setScene(scene);
primaryStage.show();
Books.clear();
While (resultSet.next()) {
listView.getItems().setAll(books);
} catch (SQLException e) {
e.printStackTrace();
Launch(args);
```