java
java
*;
this.length = length;
this.width = width;
super(side, side);
return length;
}
int n = Integer.parseInt(scanner.nextLine());
int l = Integer.parseInt(input[0]);
int w = Integer.parseInt(input[1]);
if (l == w) {
shapes.add(new Square(l));
} else {
System.out.println("Shape\tArea");
scanner.close();
}
import java.util.*;
this.maSv = maSv;
this.hoTen = hoTen;
this.chuyenNganh = chuyenNganh;
return maSv;
this.maSv = maSv;
return hoTen;
this.hoTen = hoTen;
return chuyenNganh;
System.out.println(this.toString());
return this.maSv.compareTo(that.maSv);
public SinhVienVMU(String maSv, String hoTen, String chuyenNganh, int mosWord, int mosExcel) {
this.mosWord = mosWord;
this.mosExcel = mosExcel;
return mosWord;
return mosExcel;
this.mosExcel = mosExcel;
int n = Integer.parseInt(scanner.nextLine());
if (parts.length == 3) {
} else if (parts.length == 5) {
System.out.println(sv);
scanner.close();
while (number != 0) {
number /= 10;
return reversed;
}
public class PhanSo {
public PhanSo() {
this.tu = 0;
this.mau = 1;
if (mau == 0) {
this.tu = tu;
this.mau = mau;
rutGon();
System.out.println(this.toString());
this.tu = -this.tu;
if (this.tu == 0) {
this.tu = this.mau;
this.mau = temp;
rutGon();
this.mau /= gcd;
if (this.mau < 0) {
this.tu = -this.tu;
this.mau = -this.mau;
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
return a;
}
import java.util.ArrayList;
class Candidate {
public Candidate(int id, String name, String gender, String birthday, String email, double gpa) {
this.id = id;
this.name = name;
this.gender = gender;
this.birthday = birthday;
this.email = email;
this.gpa = gpa;
return id;
this.id = id;
return name;
this.name = name;
return gender;
this.gender = gender;
}
public String getBirthday() {
return birthday;
this.birthday = birthday;
return email;
this.email = email;
return gpa;
this.gpa = gpa;
return String.format("%d, %s, %s, %s, %s, %.2f", id, name, gender, birthday, email, gpa);
class CandidateManagement {
private ArrayList<Candidate> candidateList;
public CandidateManagement() {
candidateList.add(candidate);
if (candidateList.get(i).getId() == id) {
candidateList.remove(i);
break;
System.out.println(candidate);
System.out.println(c1);
Candidate c2 = new Candidate(1, "Bill", "Male", "20-May-1980", "[email protected]", 3.9);
System.out.println(c2);
c2.setId(2);
c2.setName("Mary");
c2.setGender("Female");
c2.setBirthday("21-Jun-1981");
c2.setEmail("[email protected]");
c2.setGpa(4.0);
System.out.println(c2);
cm.addCandidate(c3);
cm.addCandidate(c4);
cm.addCandidate(c5);
cm.addCandidate(c6);
cm.display();
}
import java.util.*;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.age = age;
return firstName;
this.firstName = firstName;
return lastName;
this.lastName = lastName;
return email;
this.email = email;
return age;
}
public void setAge(int age) {
this.age = age;
Objects.equals(email, person.email);
int n = Integer.parseInt(sc.nextLine());
personList.sort(Collections.reverseOrder());
System.out.println(p);
sc.close();
}
import java.util.*;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.age = age;
return firstName;
return lastName;
this.lastName = lastName;
return email;
this.email = email;
return age;
this.age = age;
}
public boolean equals(Person that) {
this.lastName.equals(that.lastName) &&
this.email.equals(that.email) &&
this.age == that.age;
if (obj != null) {
return -1;
return 1;
else
return 0;
return -1;
int n = Integer.parseInt(sc.nextLine());
Collections.sort(personList);
System.out.println(p);
sc.close();
}
import java.util.Scanner;
class Point
private int x;
private int y;
public Point()
x = 0;
y = 0;
this.x = x; this.y = y;
return x;
this.x = x;
return y;
this.y = y;
@Override
class Line
{
private Point pointA;
public Line()
this.pointA = pointA;
this.pointB = pointB;
return pointA;
return pointB;
return pointA.distance(pointB);
{
public static void main(String[] args)
int n = sc.nextInt();
x1 = sc.nextInt(); y1 = sc.nextInt();
x2 = sc.nextInt(); y2 = sc.nextInt();
x3 = sc.nextInt(); y3 = sc.nextInt();
l1 = new Line(p1,p2);
l2 = new Line(p1,p3);
l3 = new Line(p2,p3);
}
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
this.fullName = fullName;
this.gender = gender;
this.phone = phone;
this.email = email;
}
public Student(String fullName, String gender, String phone, String email, String studentId, double
theory, double practice) {
this.studentId = studentId;
this.theory = theory;
this.practice = practice;
}
public void purchaseParkingPass() {
public Teacher(String fullName, String gender, String phone, String email, double basicSalary,
double subsidy) {
this.basicSalary = basicSalary;
this.subsidy = subsidy;
int n = Integer.parseInt(scanner.nextLine());
if (input[0].equals("Student")) {
} else if (input[0].equals("Teacher")) {
System.out.println(teacher);
}
}
import java.util.Scanner;
import java.util.ArrayList;
int n = scanner.nextInt();
arr[i] = scanner.nextInt();
int minIndex = 0;
minValue = arr[i];
minIndex = i;
}
import java.util.Scanner;
class Animal {
this.name = name;
this.numOfLegs = numOfLegs;
return name;
this.name = name;
return numOfLegs;
this.numOfLegs = numOfLegs;
super(name, numOfLegs);
System.out.println("TWEET");
super(name, numOfLegs);
System.out.println("MOO");
}
class Dog extends Animal {
super(name, numOfLegs);
System.out.println("WOOF");
System.out.println(a1);
a1.makeSound();
System.out.println(a2);
a2.makeSound();
System.out.println(a3);
a3.makeSound();
a1.setName("Clive");
a1.setNumOfLegs(a1.getNumOfLegs() + 1);
System.out.println(a1);
a2.setName("Cinnamon");
a2.setNumOfLegs(a2.getNumOfLegs() + 2);
System.out.println(a2);
a3.setName("Sadie");
a3.setNumOfLegs(a3.getNumOfLegs() + 3);
System.out.println(a3);
int n = scanner.nextInt();
scanner.nextLine();
scanner.nextLine();
if (type.equals("Bird")) {
} else if (type.equals("Cow")) {
} else if (type.equals("Dog")) {
}
for (Animal animal : arr) {
System.out.println(animal);
animal.makeSound();
}
import java.util.ArrayList;
import java.util.Scanner;
class Point {
private int x, y;
public Point() {
this.x = 0;
this.y = 0;
this.x = x;
this.y = y;
}
public int getX() {
return x;
this.x = x;
return y;
this.y = y;
this.x += dx;
this.y += dy;
@Override
}
class Line {
this.pointA = pointA;
this.pointB = pointB;
return pointA;
return pointB;
return pointA.distance(pointB);
@Override
public String toString() {
int n = scanner.nextInt();
scanner.nextLine();
int x1 = Integer.parseInt(data[0]);
int y1 = Integer.parseInt(data[1]);
int x2 = Integer.parseInt(data[2]);
int y2 = Integer.parseInt(data[3]);
lines.add(line);
if (line.isHorizontal()) {
System.out.println(line);
}
import java.util.*;
import java.util.Objects;
import java.util.Scanner;
public Book() {
this.name = null;
this.numOfPages = 0;
this.price = 0.0;
this.name = name;
this.numOfPages = numOfPages;
this.price = price;
return name;
this.name = name;
return numOfPages;
this.numOfPages = numOfPages;
return price;
}
public void setPrice(double price) {
this.price = price;
@Override
@Override
class BookReaderWriter {
this.scanner = scanner;
return book;
}
System.out.println(book.toString());
int n = scanner.nextInt();
int b = scanner.nextInt();
scanner.nextLine();
books.add(book);
Collections.sort(books, Collections.reverseOrder());
bookReaderWriter.writeRecord(books.get(i));
}
}
if (n == 0) {
return;
printHexa(n / 16);
} else {
System.out.print(reminder);
}
import java.util.*;
Collections.sort(wordList, Collections.reverseOrder());
System.out.print(wordList.get(i));
if (i != wordList.size() - 1) {
System.out.print(" ");
} else {
System.out.print(" ");
}
class Rational {
if (denominator == 0) {
if (this.denominator < 0) {
this.numerator = -this.numerator;
this.denominator = -this.denominator;
public Rational() {
this.numerator = 1;
this.denominator = 1;
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
return a;
if (r2.numerator == 0) {
@Override
}
import java.util.*;
this.maSv = maSv;
this.hoTen = hoTen;
this.chuyenNganh = chuyenNganh;
return maSv;
}
this.maSv = maSv;
return hoTen;
this.hoTen = hoTen;
return chuyenNganh;
this.chuyenNganh = chuyenNganh;
System.out.println(this.toString());
@Override
return "SinhVien(" + maSv + ", " + hoTen + ", " + chuyenNganh + ")";
}
@Override
return this.maSv.compareTo(that.maSv);
public SinhVienVMU(String maSv, String hoTen, String chuyenNganh, int mosWord, int mosExcel) {
this.mosWord = mosWord;
this.mosExcel = mosExcel;
return mosWord;
this.mosWord = mosWord;
return mosExcel;
this.mosExcel = mosExcel;
}
@Override
return "SinhVienVMU(" + maSv + ", " + hoTen + ", " + chuyenNganh + ", " + mosWord + ", " +
mosExcel + ")";
int n = Integer.parseInt(sc.nextLine());
if (parts.length == 3) {
sinhVienList.add(sinhVien);
} else if (parts.length == 5) {
sinhVienList.add(sinhVienVMU);
sinhVien.inThongTin();
sc.close();
Câu
For example:
Toi-ac-va-trung-phat 99 190000
import java.util.*;
import java.util.Objects;
import java.util.Scanner;
class Book implements Comparable<Book> {
public Book() {
this.name = null;
this.numOfPages = 0;
this.price = 0.0;
this.name = name;
this.numOfPages = numOfPages;
this.price = price;
return name;
this.name = name;
return numOfPages;
return price;
this.price = price;
@Override
@Override
class BookReaderWriter {
this.scanner = scanner;
return book;
System.out.println(book.toString());
int n = scanner.nextInt();
int b = scanner.nextInt();
scanner.nextLine();
books.add(book);
}
Collections.sort(books, Collections.reverseOrder());
bookReaderWriter.writeRecord(books.get(i));