15,892,537 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Freddie Francis (Top 13 by date)
Freddie Francis
8-Mar-23 12:18pm
View
ive moved the calls into their respected class but it still tells me undeclared, for example here;
public class Journal extends Publication
{
// The year and month when the journal was published
private int month;
/**
* Create a journal.
*
* @param title The title of the journal
* @param month The month when the journal was published
* @param year The year when the journal was published
*/
public Journal(String title, int month, int year)
{
super(title, year);
this.month = month;
database.addPublication(journal);
}
Freddie Francis
8-Mar-23 11:38am
View
it is done on blueJ
Freddie Francis
8-Mar-23 11:23am
View
ive tried doing this but i am getting error message, undeclared variables.
public class Database {
private ArrayList<publication> publicationList; // An array list collection of publications
/**
* Create a new database
*/
public Database() {
publicationList = new ArrayList<publication>();
}
/**
* Add a publication
*
* @param publication The publication to be added
*/
public void addPublication(Publication publication) {
if (publicationList.contains(publication)) {
System.out.println("This publication has already been added to the list: " + publication);
} else {
publicationList.add(publication);
database.addPublication(book);
database.addPublication(journal);
}
}
Freddie Francis
4-Dec-22 8:24am
View
Sorry i forgot to add my last method.
public Alien getNonHumanoids()
{
Iterator<alien> it = aliens.iterator();
while(it.hasNext()){
Alien alien = it.next();
if(alien.getHumanoid() == false){
it.remove();
nonHumanoids.add(alien);
}
}
}
Freddie Francis
2-Dec-22 11:14am
View
would this be correct
public void printNumbers()
{
System.out.print (numbers+"");
}
Freddie Francis
1-Dec-22 11:36am
View
yes i understand, is there also a method for printing out the keys in a hashmap
Freddie Francis
1-Dec-22 11:05am
View
but i need to method to return null if no matching name
Freddie Francis
1-Dec-22 11:00am
View
ive got this so far. public String lookUpNumber(String name)
{
if(name = ){
get.HashMap();
}
else{
return null;
}
}
But not sure what to include in the if statement
Freddie Francis
1-Dec-22 10:54am
View
ive got this so far. public String lookUpNumber(String name)
{
if(name = ){
get.HashMap();
}
else{
return null;
}
}
But not sure what to include in the if statement
Freddie Francis
25-Nov-22 7:41am
View
would this be correct.
Random rand = new Random(); int index = rand.nextInt(choices.size()); return choices.get(index)
Freddie Francis
21-Nov-22 16:45pm
View
sorry, but i cannot include a break statement inside the loop, i need another way
Freddie Francis
21-Nov-22 12:29pm
View
what am i doing wrong here. It tells me that theres no suitable method found for abs:
if(distance < nearestDistance){
nearestDistance = distance(Math.abs());
nearestAssistant = assistant;
}
Freddie Francis
21-Nov-22 8:18am
View
Deleted
Im still unsure how to do this. Ive got this at the moment but its not correct.
else if(distance == nearestDistance){
if(identity < higherID){
nearestAssistant = assistant;
}
}
Show More