Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
To create User objects: --for each type, I have two constructors, one with only the basics and one with all info. Feel free to just choose for now i guess :) STUDENT: public Student(String userName, String password, String email) { super(userName, password, email); super.setRole("S"); } public Student(String userName, String firstName, String lastName, String email, String password) { super(userName, firstName, lastName, email, password); super.setRole("S"); } TEACHER: public Teacher(String userName, String firstName, String lastName, String email, String password) { super(userName, firstName, lastName, email, password); super.setRole("T"); } public Teacher(String userName, String password, String email) { super(userName, password, email); super.setRole("T"); } ADMIN: public Admin(String userName, String firstName, String lastName, String email, String password) { super(userName, firstName, lastName, email, password); super.setRole("A"); } public Admin(String userName, String password, String email) { super(userName, password, email); super.setRole("A"); } ADDING TO DB: //create AppDAO object AppDAO appDAO = new AppDAO(); //pass in User object (any of the three subclasses will work) appDAO.insertNewUser(user); //profit!!?
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)