Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
public class Factorial{
public static void main(String[] args) {
int i=10,num,fact=1,count=0;
Scanner sc=new Scanner(System.in);
num=sc.nextInt();
int n=num;
while(num>0){
import java.util.Scanner;
public class Prod{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int max=0;
int num=1;
import java.util.ArrayList;
public class Vector1{
public static void main(String[] args) {
int arr[][]={{1,2,3},{4,5,6},{7,8,9}};
ArrayList<Integer> l1=new ArrayList<Integer>();
ArrayList<Integer> l2=new ArrayList<Integer>();
import java.util.Scanner;
interface AdvanceArithmetic{
int divi_sum(int n);
}
public class MyCalculator implements AdvanceArithmetic {
public int divi_sum(int n) {
class Member{
String name;
int age;
String phone_number;
String address;
int salary;
Member(String name,int age,String phone_number,String address,int salary){
this.name = name;
this.age = age;
abstract class Marks{
abstract double getPercentage();
}
class A extends Marks{
int sub1,sub2,sub3;
int sum;
double per;
public class Main3{
Main3(){
System.out.println("Unknown");
}
Main3(String Name){
System.out.println(Name);
}
class even implements Runnable{
synchronized public void run(){
for(int i=1;i<=20;i++){
if(i%2==0){
System.out.println(i);
}
}
}
import java.sql.*;
import java.util.Objects;
import java.util.Scanner;
public class StudentInfo{
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jdbc", "root", "123456");
Statement s = con.createStatement();
//EXAMPLE OF OVERLOADING CONSTRUCTOR
class Overloading {
double width;
double height;
double length;
//FIRST CONSTRUCTOR IS CREATED
Overloading(double w,double h,double l) {
width = w;
height = h;