Skip to content
Snippets Groups Projects
Commit a48e5f77 authored by Mahboobe Shakeri's avatar Mahboobe Shakeri
Browse files

packqge added with a class

parent 442cf1e5
Branches main
No related tags found
No related merge requests found
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or //TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter. // click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
import cpsc219.fall2024.*;
import java.util.Scanner; import java.util.Scanner;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
...@@ -9,6 +11,9 @@ import java.io.*; ...@@ -9,6 +11,9 @@ import java.io.*;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
student myStudent = new student("30192525", "mahboobe", "shakeri", 26);
System.out.println(myStudent.getFirst_name());
// String test = "My name is John and I am 25 years old."; // String test = "My name is John and I am 25 years old.";
// System.out.println(test.toLowerCase()); // System.out.println(test.toLowerCase());
// System.out.println(test); // System.out.println(test);
......
package cpsc219.fall2024;
public class student {
private String id;
private String first_name;
private String last_name;
private int age;
public student(String id, String first_name, String last_name, int age) {
this.id = id;
this.first_name = first_name;
this.last_name = last_name;
this.age = age;
}
public String getId() {
return id;
}
public String getFirst_name() {
return first_name;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment