Edu Bridege
Edu Bridege
shubham patil:==
Enrollment Number :
EBEON0823830336
Batch :
2023-10232
Enlorment no:_---EBEON0823830344
ECLIPSE ZIP:
https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/
release/2023-06/R/eclipse-jee-2023-06-R-win32-x86_64.zip&mirror_id=1142
Homework:
subtration, multiplicatio, division /, %
area of square, reactangle, triangle and circle
Date: 08/08/2023
PPT on Java Architecture
Date: 10/08/2023
1. Program to check the given number positive or negative
2.Program to check the given number is odd or even
3.Program to find the largest 2 numbers using if else
Date: 11/08/2023
package com.edu;
import java.util.Scanner;
String name;
int units;
float amount;
}
else if(units>300 && units<=400) {
amount = 200*3.80f+100*4.40f+(units-300)*5.10f;
}
else {
amount = 200*3.80f+100*4.40f+100*5.10f+(units-400)*5.80f;
}
System.out.println("Customer Name:"+name);
System.out.println("Units Consumed "+units);
System.out.println("Amount to pay Rs."+amount);
Date- 17/08/2023
1.program to find sum of all array elements
2.to find the average of all array elements
3.find larget of all array elements
4.find the smallest of all array elements
5. Find the elements exists in given array(linear search)
6.find 2nd largest element from the given array
(Bubble sort)
package com.edu;
import java.util.Scanner;
for(int r=0;r<3;r++) {
for(int c=0;c<3;c++) {
arr[r][c]=sc.nextInt();
}
}
Date- 18/08/2023
System.out.print(s2);
}
}
package com.edu;
import java.util.Scanner;
int num;
Scanner sc = new Scanner(System.in);
System.out.println("Enter number");
num = sc.nextInt();
// for(int i=str.length()-1;i>=0;i--) {
// System.out.print(str.charAt(i));
// }
Date= 21/08/2023
package com.edu;
class Addition{
void add(int i, int j){
int s=i+j;
System.out.println("Integer addition s="+s);
}
void add(short i, short j){
short s=(short) (i+j);
System.out.println("short addition s="+s);
}
void add(long i, long j){
long s=i+j;
System.out.println("long addition s="+s);
}
void add(byte i, byte j){
byte s=(byte) (i+j);
System.out.println("byte addition s="+s);
}
void add(float i, float j){
float s=i+j;
System.out.println("float addition s="+s);
}
void add(double i, double j){
double s=i+j;
System.out.println("double addition s="+s);
}
}
}
}
---------------------------------------------------------
Date 24/08/2023
Abstraction
public class BankMain{
public static void main(String args[]){
Bank bob;
//HdfcBank hob=new HdfcBank();
bob=new HdfcBank();
java links:::::https://vtuupdates.com/vtu/21csl35-java-laboratory-solutions/
Date 24/08/2023
class Mobile {
void ringTone() {
System.out.println("Default RingTone");
}
void theme() {
System.out.println("Default Theme");
}
//final method cannot be overriden
final void ram() {
System.out.println("4GB RAM");
}
}
// @Override
// void ram() {
// System.out.println("8GB RAM");
// }
class Car{
void start() {
System.out.println("START");
}
void move() {
System.out.println("MOVE");
}
void stop() {
System.out.println("STOP");
}
}
Vehicle() {
System.out.println("ZERO AURG CONSTURUCTOR");
}
void start() {
System.out.println("START");
}
}
void move() {
System.out.println("MOVE");
}
void stop() {
System.out.println("STOP");
}
Bike(String colour) {
super(colour);
@Override
void wheels() {
System.out.println("TWO WHEELS");
@Override
void wheels() {
System.out.println("THREE WHEELS");
package com.edu;
import java.io.*;
import java.util.*;
public class OccurrenceOfChar{
static void count_characters(String input_str){
HashMap<Character, Integer> my_map = new HashMap<Character, Integer>();
char[] str_array = input_str.toCharArray();
for (char c : str_array){
if (my_map.containsKey(c)){
my_map.put(c, my_map.get(c) + 1);
}else{
my_map.put(c, 1);
}
}
for (Map.Entry entry : my_map.entrySet()){
System.out.println(entry.getKey() + " " + entry.getValue());
}
}
public static void main(String[] args){
String my_str = "Joe Erien ";
System.out.println("The occurence of every character in the string is ");
count_characters(my_str);
}
}
Date= 05/09/2023
package com.edu;
@FunctionalInterface
interface Message{
void display();
mob.display();
package com.edu;
@FunctionalInterface
interface Subtraction{
int sub(int i, int j);
}
Subtraction s1=(i,j)->(i-j);
System.out.println("difference "+s1.sub(6, 2));
}
package com.edu;
@FunctionalInterface
interface Message{
void display();
}
@FunctionalInterface
interface Addition{
void add(int a, int b);
}
mob.display();
Date = 13/09/2023
import java.sql.Connection;
import java.sql.DriverManager;
try {
//1. Load the driver
//Class.forName("com.mysql.cj.jdbc.Driver");
Class.forName(driver);
Connection conn=DriverManager.getConnection(url,un,pass);
if(conn!=null) {
System.out.println("connection established");
}
else {
System.out.println("Not connected");
}
}catch(Exception e) {
e.printStackTrace();
}
try {
//1. Load the driver
//Class.forName("com.mysql.cj.jdbc.Driver");
Class.forName(driver);
Connection conn=DriverManager.getConnection(url,un,pass);
if(conn!=null) {
System.out.println("connection established");
Statement st=conn.createStatement();
String sql= "select * from login";
ResultSet rs=st.executeQuery(sql);
w
while(rs.next()){
//getInt
//getFloat
//System.out.println(rs.getString("emailid")+"
"+rs.getString("password"));
System.out.println(rs.getString(1)+" "+rs.getString(2));
}
}
else {
System.out.println("Not connected");
}
}catch(Exception e) {
e.printStackTrace();
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Scanner;
public class GetRecordBasedEmailID {
try {
//load the driver
Class.forName(driver);
//Make the connection
conn = DriverManager.getConnection(url,un,pass);
//create a Statement
stmt = conn.createStatement();
System.out.println("Enter email id");
String em=sc.next();
//select * from login where emailid='[email protected]'
String s="select * from login where emailid='"+em+"'";
rs = stmt.executeQuery(s);
if(rs.next()) {
System.out.println("user exists with email id
"+rs.getString("emailid"));
}
else {
System.out.println("User not exists with email id ="+em);
}
}catch(Exception e) {
e.printStackTrace();
}
}
package com.edu;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
try {
//load the driver
Class.forName(driver);
//Make the connection
conn = DriverManager.getConnection(url,un,pass);
//create a Statement
stmt = conn.createStatement();
System.out.println("Enter email id");
String em=sc.next();
//select * from login where emailid='[email protected]'
String s="select * from login where emailid='"+em+"'";
rs = stmt.executeQuery(s);
if(rs.next()) {
System.out.println("user exists with email id
"+rs.getString("emailid"));
}
else {
System.out.println("User not exists with email id ="+em);
}
}catch(Exception e) {
e.printStackTrace();
}
finally {
stmt.close();
rs.close();
conn.close();
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
try {
//load the driver
Class.forName(driver);
//Make the connection
conn = DriverManager.getConnection(url,un,pass);
//create a Statement
stmt = conn.createStatement();
System.out.println("Enter email id");
String em=sc.next();
//select * from login where emailid='[email protected]'
String s="select * from login where emailid='"+em+"'";
rs = stmt.executeQuery(s);
if(rs.next()) {
//System.out.println("user exists with email id
"+rs.getString("emailid"));
System.out.println("Enter password to change");
String upass=sc.next();
String pu="update login set password='"+upass+"' where
emailid='"+em+"'";
int i=stmt.executeUpdate(pu);
if(i>0) {
System.out.println("Password changed successfully");
}else {
System.out.println("Error occurred");
}
}
else {
System.out.println("User not exists with email id ="+em);
}
}catch(Exception e) {
e.printStackTrace();
}
finally {
stmt.close();
rs.close();
conn.close();
}
Date= 14/09/2023
https://edubridgeindia.zoom.us/j/2335853210
}
import java.util.HashMap;
import java.util.Map;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandle
r;