Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Constructor Example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package Java;

public class Student {
String studentName;

public Student(String studentName) {
this.studentName = studentName;
}

public String getStudentName;
}




package Java;

public class Test {
public static void main(String[] args) {
Student a = new Student("Jack");
System.out.println(a.studentName);
System.out.println(a.getStudentName);
}
}
14 changes: 14 additions & 0 deletions Random Number
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package RandomNumber;

import java.util.Random;

public class RandomNumber {
public static void main(String[] args) {
Random r = new Random();
//printing 10 random numer between 0 to 500
for (int i = 0; i < 10; i++) ;
System.out.println(r.nextInt(500));


}
}