473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Class or Interface expected error

24
I made sure I closed all the bracket, why do i still get the error.

on line 360, 424, 425 and 607

Please help


/*
* ShopCartServletHW3.java
*
* Created on November 19, 2007, 5:42 PM
*/

package ITIS4166HW5;

import java.io.*;
import java.net.*;
import java.lang.*;
import java.util.*;
import java.text.*;

import javax.servlet.*;
import javax.servlet.http.*;

/**
*
* @author Administrator
* @version
*/
public class ShopCartServletHW3 extends HttpServlet {

/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
private String pageTop01;
private String pageTop02;
private String pageTop03;
private String pageTop04;
private String pageTable01Top;
private String pageTable01Bottom;
private String pageBottom;
private String pageItemEmpty;
private String confirmTable01Bottom;
private String confirmTableTop;
private String confirmItemEmpty;

private Hashtable pageItemList = new Hashtable();
private Hashtable confirmItemList = new Hashtable();
private double runningTotal;
private ShopCartDataHW3 cartData;
private InvTrackerHW3 invTracker;
private Hashtable pastOrders;

public void init() throws ServletException {
PageTop01 = "<html>"
+ "<head>"
+ "<title>Blue Ridge Supply Shopping Cart </title>"
+ "</head>"
+ "<style type=\"text/css\">"
+ "body {font-family: arial}"
+ "h1 {color: navy}"
+ "h2 {color: navy}"
+ "h3 {color: white}"
+ "h4 {color: white"
+ "h5 {color: white}"
+ "h6 {color: navy}"
+ "p {color: navy}"
+ "</style>"
+ "<body>";
pageTop02 = "<table border=\"0\" width=\"100%\" cellpadding=\"0\">"
+ "<tr><td width=\"25%\" valign=\"top\">"
+ "Shopper: ";
pageTop03 = "<br>"
+ "<a href=\"RegLoginServletHW3\"> [Log Out]</a>"
+ " "
+ "<a href=\"CatServletHW3\">[Continue Shopping]</a></td>"
+ "<td width=\"50%\" valign=\"bottom\" align=\"center\"><h1>"
+ "Blue Ridge Supply - Shopping Cart"
+ "</h1>"
+ "<td width=\"25%\" valign=\"top\" align=\"right\">"
+ "Shopping Cart contains ";
pageTop04 = " items </em> "
+ "</td></tr></table><hr>";
pageTable01Top = "<center><h3>"
+ "Please review sections:"
+ "</h3><table border=\"1\" cellpadding=\"10\" align=\"center\" valign=\"middle\" bgcolor=\"navy\">"
+ "<tr><th><h4><br>"
+ "Quantity"
+ "</h4></th<th><h4>"
+ "Item"
+ "</h4></th><th><h4>"
+ "Unit Price"
+ "</h4></th></th><h4>"
+ "Total Price"
+ "</h4></th></tr>";
pageBottom = "</body></html>";
}

protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

HttpSession session = request.getSession();
if (session.isNew() || session == null) {
sessionError( request, response);
}
String userID;
if (session.getAttribute("userID") != null) {
userID = (String)session.getAttribute("userID");
} else {
sessionError( request, response);
userID = "";
}
Integer cartCount;
if (session.getAttribute("cartCount") != null)
{
cartCount = (Integer)session.getAttribute("cartCount");
} else {
sessionError( request, response);
cartCount = Integer.valueOf(0);
}
if (session.getAttribute("pastOrders") != null)
{
pastOrders = (Hashtable)
session.getAttribute("pastOrders");
} else {
sessionError( request, response);
pastOrders = new Hashtable();
}

if (session.getAttribute("invTracker") != null)
{
invTracker = (InvTrackerHW3)
session.getAttribute("invTracker");
}

String shiptoname;
String streetaddress;
String city;
String state;
String zip;
String shipservice;
String cctype;
String ccname;
String ccnum;
String ccexpmonth;
String ccexpyear;

// Shipping information

Hashtable shipHash;
if ((session.getAttribute("shipping") != null))
{
shipHash = ((Hashtable)session.getAttribute("shipping"));
} else {
shipHash = new Hashtable();
}
String [] shipping = new String[5];
if (shipHash.get(userID) != null) {
shipping = (String[])shipHash.get(userID);
shiptoname = shipping[0];
streetaddress = shipping[1];
city = shipping[2];
state = shipping[3];
zip = shipping[4];
} else {
shiptoname = "";
streetaddress = "";
city = "";
state = "";
zip = "";
}

/*
if ((session.getAttribute("shiptoname") != null)) {
shiptoname = filter((String) session.getAttribute("shiptoname"))
*/

// Credit information

if ((session.getAttribute("shipservice") != null)) {
shipservice = filter((String) session.getAttribute("shipservice"));
} else {
shipservice = "";
}
if ((session.getAttribute("ccname") != null)) {
ccname = filter((String) session.getAttribute("ccname"));
} else {
ccname = "";
}
if ((session.getAttribute("cctype") != null)) {
cctype = filter((String) session.getAttribute("cctype"));
} else {
cctype = "";
}
if ((session.getAttribute("ccnum") != null)) {
ccnum = filter((String)session.getAttribute("ccnum"));
} else {
ccnum = "";
}
if ((session.getAttribute("ccexpmonth") != null)) {
ccexpmonth = filter((String) session.getAttribute("ccexpmonth"));
} else {
ccexpmonth = "";
}
if ((session.getAttribute("ccexpyear") != null)) {
ccexpyear = filter((String) session.getAttribute("ccexpyear"));
} else {
ccexpyear = "";
}


if (session.getAttribute("cart") != null && session.getAttribute("cartKeys") != null)
cartData = new ShopCartDataHW3((Hashtable) session.getAttribute("cart"), (Hashtable)
session.getAttribute("cartKeys"));
else {
cartData = new ShopCartDataHW3(new Hashtable(), new Hashtable());
}

String itemToAdd;
itemToAdd = (findItemAttribute(request, response));
if ((itemToAdd != null) && (cartData.getItemID(itemToAdd) == null)) {
cartData.updateItemID(itemToAdd, 1);
}

if (itemToAdd != null) {
int defaultValue = (cartData.getQty(itemToAdd).intValue());
int x = getIntParameter(request, itemToAdd, defaultValue);
if (x < 0) {
// do nothing
} else {
cartData.updateItemID(itemToAdd, x);
}
}

Hashtable cart = new Hashtable(cartData.getCart());
Hashtable cartKeys = new Hashtable (cartData.getCartKeys());
session.setAttribute("cart", cart);
session.setAttribute("cartKeys", cartKeys);

Integer numberOfKeys = new Integer (cartKeys.size());
session.setAttribute("cartCount", numberOfKeys);

runningTotal = 0;

Enumeration keyValues = cartKeys.elements();
while(keyValues.hasMoreElements()) {
String key = (String) keyValues.nextElement();
if (key != null) {
setCartPage(key, cartData);
setConfirmItemList(key, cartData);
}
}

if (numberOfKeys.intValue() == 0) {
setCartPage(null, cartData);
}
String shippingAndCredit = loadShippingAndCredit(shiptoname, streetaddress, city, state, zip, shipservice, cctype, ccname, ccnum, ccexpmonth, ccexpyear);
if (numberOfKeys.intValue() == 0) {
session.setAttribute("confirm", "");
} else {
setConfirm(session, cartKeys, numberOfKeys);
}

showPage(request, response, userID, cartKeys, numberOfKeys, shippingAndCredit);

}

private void showPage(HttpServletRequest request,
HttpServletResponse response, String userId, Hashtable cartKeys, Integer numberOfKeys, String shippingAndCredit)
throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println(pageTop01 + pageTop02 + userID + pageTop03 + numberOfKeys + pageTop04);
out.println(shippingAndCredit);
out.println(pageTable01Top);

Enumeration keyValues = cartKeys.elements();
while(keyValues.hasMoreElements()) {
String key = (String)keyValues.nextElement();
if (key != null) {
out.println(pageItemList.get(key));
}
}
if (numberOfKeys.intValue() == 0) {
out.println(pageItemEmpty);
}

out.println(pageTable01Bottom + pageBottom);
out.close();
}


private String findItemAttribute(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String) paramNames.nextElement();
CatalogHW3 item = new CatalogHW3();
if (item.getItem(paramName) != null) {
return paramName;
}
}
return null;
}

private void setCartPage(String key, ShopCartDataHW3 cartData) {

String pageItemFormat00 = "<form action=\"ShopCartServletHW3\" method=\"post\"><tr bgcolor=\"white\"><td align=\"center\">"
+ "<input type=\text\" name=\"";
String pageItemFormat01 = "\" value=\"";
String pageItemFormat02 = "\" size=\"3\" align=\"right\">"
+ "<input type=\"submit\" name=\"Update\" value=\"Update\" />"
+ "<br>";
String pageItemFormat03 = "</td><td><img src=\"";
String pageItemFormat04 = "\" align=\"middle\" width=\"48\" height=\"48\"> ";
String pageItemFormat05 = "</td><td align=\"right\">";
String pageItemFormat06 = "</td><td align=\"right\">";
String pageItemFormat07 = "</td></tr></form>";

DecimalFormat f = new DecimalFormat();

if (key != null) {

int qtyOnHand = invTracker.getQtyOnHand(key);
int qtyAvailable = qtyOnHand - cartData.getQty(key).intValue();

if (qtyAvailable < 0) {
cartData.updateItemID(key, invTracker.getQtyOnHand(key));
qtyAvailable = 0;
}

double total = ((cartData.getQty(key).intValue() * cartData.getCost(key)));

pageItemList.put(key, pageItemFormat00
+ cartData.getItemID(key)
+ pageItemFormat01
+ cartData.getQty(key)
+ pageItemFormat02
+ qtyAvaliable + " More Avaliable "
+ pageItemFormat03
+ cartData.getImagePath(key)
+ pageItemFormat04
+ cartData.getDescription(key)
+ pageItemFormat05
+ "$" + f.format(cartData.getCost(key))
+ pageItemFormat06
+ "$" + f.format(total)
+ pageItemFormat07);

runningTotal = total + runningTotal;
} else {
pageItemEmpty = "<tr bgcolor=\"white\"><td colspan=\"4\" align=\"center\">"
+ "Your Shopping Cart is empty ... Please buy something."
+ "</td></tr>";
runningTotal = 0;
}

pageTable01Bottom = "<tr><td colspan=\"4\" align=\"Right\"><h4> Total Order: $ "
+ f.format(runningTotal)
+ "</h4></td></tr></table>";
}
}
private void setConfirmItemList(String key, ShopCartDataHW3 cartData) {
confirmTableTop = "<center><h3>"
+ "Order Details"
+ "<table border=\"1\" cellpadding=\"10\" align=\"center\" valign=\"middle\">"
+ "<tr><th><h4><br>"
+ "Quantity"
+ "</h4></th<th><h4>"
+ "Item"
+ "</h4></th><th><h4>"
+ "Unit Price"
+ "</h4></th></th><h4>"
+ "Total Price"
+ "</h4></th></tr>";
String confirmItemFormat00 = "<tr bgcolor=\"white\"><td align=\"center\">";
String confirmItemFormat01 = "<td align=\"right\">";
String confirmItemFormat02 = "</td><td>";
String confirmItemFormat03 = "<img src =\"";
String confirmItemFormat04 = "\" align=\"middle\" width=\"48\" height=\"48\"> ";
String confirmItemFormat05 = "</td><td align=\"right\">";
String confirmItemFormat06 = "</td><td align=\right\">";
String confirmItemFormat07 = "</td></tr>";

DecimalFormat f = new DecimalFormat();

if (key != null) {
double total = ((cartData.getQty(key).intValue() * cartData.getCost(key)));
confirmItemList.put(key,
confirmItemFormat01
+ cartData.getQty(key)
+ confirmItemFormat02
+ confirmItemFormat03
+ cartData.getImagePath(key)
+ confirmItemFormat04
+ cartData.getDescription(key)
+ confirmItemFormat05
+ "$" + f.format(cartData.getCost(key))
+ confirmItemFormat06
+ "$" + f.format(total)
+ confirmItemFormat07);
}

confirmTable01Bottom = "<tr><td colspan=\"4\" align=\"Right\"><h4>TOTAL ORDER: $ "
+ f.format(runningTotal)
+ "</h4></td></tr></table>";
}

private void setConfirm(HttpSession session,
Hashtable cartKeys, Integer numberOfKeys)
throws ServletException, IOException {
StringBuffer confirm = new StringBuffer(confirmTableTop);
Enumeration keyValues = cartKeys.elements();
while(keyValues.hasMoreElements()) {
String key = (String)keyValues.nextElement();
if (key != null) {
confirm.append((String)
confirmItemList.get(key));
}
}
if (key != null) {
confirm.append((String)
confirmItemList.get(key));
}
}
confirm.append(confirmTable01Bottom);
session.setAttribute("confirm", confirm.toString());
}

private String loadShippingAndCredit(String shiptonmae, String streetaddress, String city, String state, String zip, String shipservice, String cctype, String ccname, String ccnum, String ccexpmonth, String ccexyear) {
String credit01;
String credit02;
String credit03;

String ship01;
String ship02;
String ship03;
String ship04;
String ship05;
String ship06;

credit01 = "<form action=\"PurchConfServletHW3\" method=\"post\">"
+ "<table border=\"1\" cellpadding=\"10\" bgcolor=\"navy\" align\"center\">";
ship01 = "<center><h3>"
+ "Please provide your billing and shipping information: "
+ "<input type=\"submit\" name=\"Submit Order\" value=\"Submit Order\" />"
+ "</h3></hr>";
String
bill01 = "<tr><td bgcolor=\"white\">"
+ "Card Type:"
+ "<br>"
+ "<select name=\"cctype\">"
+ "<option value=\"Visa\" selected=\"selected\"> Visa</option>"
+ "<option value=\"MasterCard\" selected=\"selected\"> MasterCard</option>"
+ "<option value=\"American Express\" selected=\"selected\">American Express</option>"
+ "</select><br>"
+ "Card Number:"
+ "<br>"
+ "<input type=\"text\" name=\"ccnum\" value=\"";
credit02 = "\"><br>"
+ "Cardholder Name:"
+ "<br>"
+ "<input type=\"text\" name=\"ccname\" value=\"";
credit03 = "\"><br>"
+ "Expiration Date:"
+ "<br>"
+ "<select name=\"ccexpmonth\">"
+ "<option value=\"Jan\">Jan</option>"
+ "<option value=\"Feb\">Feb</option>"
+ "<option value=\"Mar\">Mar</option>"
+ "<option value=\"Apr\">Apr</option>"
+ "<option value=\"May\">May</option>"
+ "<option value=\"Jun\">Jun</option>"
+ "<option value=\"Jul\">Jul</option>"
+ "<option value=\"Aug\">Aug</option>"
+ "<option value=\"Sep\">Sep</option>"
+ "<option value=\"Oct\">Oct</option>"
+ "<option value=\"Nov\">Nov</option>"
+ "<option value=\"Dec\">Dec</option>"
+ "</select>"
+ "</td>";
String
ship00 = "<td bgcolor=\"white\">"
+ "Ship To Name:"
+ "<br>"
+ "<input type=\"text\" name=\"shiptoname\" size=\"37\" value=\"";
ship02 = "\"<br>"
+ "Street Address:"
+ "<br>"
+ + "<input type=\"text\" name=\"streetaddress\" size=\"37\" value=\"";
ship03 = "\"<br>"
+ "City State Zip:"
+ "<br>"
+ "<input type=\"text\" name=\"city\" size=\"20\" value=\"";
ship04 = "\">"
+ "<input type=\"text\" name=\"state\" size=\"2\" value=\"";
ship05 = "\">"
+ "<input type=\"text\" name=\"zip\" size=\"5\" value=\"";
ship06 = "\"</td>";

String
ship00a = "<td bgcolor=\"white\">"
+ "<input type=\"radio\" checked=\"checked\" name=\"shipservice\" value=\"UPS Ground\">UPS Ground"
+ "<br><br>"
+ "<input type=\"radio\" name=\"shipservice\" value=\"UPS 2nd Day Air\">UPS 2nd Day Air"
+ "<br><br>"
+ "<input type=\"radio\" name=\"shipservice\" value=\"FedEx Priority\">FedEx Priority"
+ "<br><br>"
+ "<input type=\"radio\" name=\"shipservice\" value=\"FedEx Ultra\">FedEx Ultra"
+ "</td>";
String
ship00c = "</tr>"
+ "</table></form>";

return credit01
+ ship01
+ bill01
+ ccnum
+ credit02
+ ccname
+ credit03
+ ship00
+ shiptoname
+ ship02
+ ship03
+ streetaddress
+ city
+ ship04
+ state
+ ship05
+ zip
+ ship06
+ ship00a
+ ship00c;
}

private void sessionError(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

String sessionErrorForm;
sessionErrorForm = "<form action=\"RegLoginServletHW3\" method=\"post\"><tr bgcolor=\"white\"> <td align=\"center\">"
+ "<h3 align=\"center\">Your request has not been processed - some isseues were found. <br> Please return to the Login page. </h3>"
+ "<input type=\"submit\" name=\"Go to Login\" value=\"Go to Login\" /></form>";
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println(pageTop01 + sessionErrorForm);
out.close();
}

private String filter(String input) {
StringBuffer filter = new StringBuffer(input.length());
char c;
for(int i=0; i<input.length(); i++) {
c = input.charAt(i);
if (c == '<') {
filtered.append("&lt;");
} else if ( c == '>') {
filtered.append("&gt;");
} else if ( c == '"') {
filtered.append("&quot;");
} else if (c == '&') {
filtered.append("&amp;");
} else {
filtered.append(c);
}
}
return(filtered.toString());
}
private int getIntParameter(HttpSevletRequest request,
String paramName,
int defaultValue) {
String paramString = request.getParameter(paramName);
int paramValue;
try {
paraValue = Integer.parseInt(paramString);
} catch (NumberFormatException nfe) { // null or bad format
paramValue = defaultValue;
}
return(paramValue);
}
//<editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code>method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/** Handles the HTTP <code>POST</code>method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}
// </editor-fold>
}
Nov 20 '07 #1
15 3317
JosAH
11,448 Expert 8TB
There's something wrong with your post because this goofy forum software doesn't
diplay anything. Sorry for the inconvenience.

kind regards,

Jos
Nov 20 '07 #2
JosAH
11,448 Expert 8TB
... and after I posted my reply your post is displayed; oh brother ...
Nov 20 '07 #3
r035198x
13,262 8TB
I've looked over your code and I'm sure you missed some bracket somewhere.
Indent your code properly and all will be clear.
Nov 20 '07 #4
judge82
24
I've looked over your code and I'm sure you missed some bracket somewhere.
Indent your code properly and all will be clear.
i see. I removed the and it shows


I don't see where I am missing a bracket, I have checked that over and over
Nov 20 '07 #5
r035198x
13,262 8TB
i see. I removed the and it shows


I don't see where I am missing a bracket, I have checked that over and over
Indent it and all will be clear.
<Am I repeating myself here?>
Nov 20 '07 #6
judge82
24
Indent it and all will be clear.
<Am I repeating myself here?>
is there an easy way to indent with netbeans?
Nov 20 '07 #7
r035198x
13,262 8TB
is there an easy way to indent with netbeans?
Source-> Format
Nov 20 '07 #8
eWish
971 Expert 512MB
This line (83 or so) appears to be missing a bracket.
Expand|Select|Wrap|Line Numbers
  1. + "</h4></th<th><h4>"
edit:
Is this line missing a quote (306 or so)?
Expand|Select|Wrap|Line Numbers
  1. + "<input type=\text\" name=\"";
Missing an = sign in this line (440 or so)
Expand|Select|Wrap|Line Numbers
  1. + "<table border=\"1\" cellpadding=\"10\" bgcolor=\"navy\" align\"center\">";
I would check things again.

--Kevin
Nov 20 '07 #9
judge82
24
This line (83 or so) appears to be missing a bracket.
Expand|Select|Wrap|Line Numbers
  1. + "</h4></th<th><h4>"
edit:
Is this line missing a quote (306 or so)?
Expand|Select|Wrap|Line Numbers
  1. + "<input type=\text\" name=\"";
Missing an = sign in this line (440 or so)
Expand|Select|Wrap|Line Numbers
  1. + "<table border=\"1\" cellpadding=\"10\" bgcolor=\"navy\" align\"center\">";
I would check things again.

--Kevin

these are the lines with the errors:

line 360:
Expand|Select|Wrap|Line Numbers
  1. private void setConfirmItemList(String key, ShopCartDataHW3 cartData) {
lines 424 and 425:
Expand|Select|Wrap|Line Numbers
  1. session.setAttribute("confirm", confirm.toString());
  2.          }
and

and the last line 606
Nov 20 '07 #10
eWish
971 Expert 512MB
I would think that missing brackets, quotes etc would cause an error overall.

So, missing a bracket like this one does not hender the code at all?
Expand|Select|Wrap|Line Numbers
  1. + "h4 {color: white"
No closing >
Expand|Select|Wrap|Line Numbers
  1. + + "<input type=\"text\" name=\"streetaddress\" size=\"37\" value=\"";
  2. ship03 = "\"<br>"
Sincerely Curious....
--Kevin
Nov 20 '07 #11
judge82
24
I would think that missing brackets, quotes etc would cause an error overall.

So, missing a bracket like this one does not hender the code at all?
Expand|Select|Wrap|Line Numbers
  1. + "h4 {color: white"
No closing >
Expand|Select|Wrap|Line Numbers
  1. + + "<input type=\"text\" name=\"streetaddress\" size=\"37\" value=\"";
  2. ship03 = "\"<br>"
Sincerely Curious....
--Kevin
Thanks bro, I corrected those problems and still getting the same error
Nov 20 '07 #12
eWish
971 Expert 512MB
How about {} for the if statement?
Expand|Select|Wrap|Line Numbers
  1. if (session.getAttribute("cart") != null && session.getAttribute("cartKeys") != null)
  2. cartData = new ShopCartDataHW3((Hashtable) session.getAttribute("cart"), (Hashtable) 
  3. session.getAttribute("cartKeys"));
  4. else {
--Kevin
Nov 20 '07 #13
judge82
24
How about {} for the if statement?
Expand|Select|Wrap|Line Numbers
  1. if (session.getAttribute("cart") != null && session.getAttribute("cartKeys") != null)
  2. cartData = new ShopCartDataHW3((Hashtable) session.getAttribute("cart"), (Hashtable) 
  3. session.getAttribute("cartKeys"));
  4. else {
--Kevin

still didn't clear the error

Expand|Select|Wrap|Line Numbers
  1.         if (session.getAttribute("cart") != null && session.getAttribute("cartKeys") != null) {
  2.             cartData = new ShopCartDataHW3((Hashtable) session.getAttribute("cart"), (Hashtable) 
  3.             session.getAttribute("cartKeys"));
  4.         } else {
  5.             cartData = new ShopCartDataHW3(new Hashtable(), new Hashtable());
  6.         }
Nov 20 '07 #14
eWish
971 Expert 512MB
When in context does this belong here?
Expand|Select|Wrap|Line Numbers
  1. pageBottom = "</body></html>";
  2. } <-----
Nov 20 '07 #15
r035198x
13,262 8TB
Have You Indented The Code Yet?
Nov 20 '07 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Marcin Vorbrodt | last post by:
Taken out of C++ In a Nutshell book... Example 7-18: Using an abstract classes as interface specification. struct Runnable { virtual void run() = 0; }; struct Hashable { virtual size_t...
14
by: Lee Franke | last post by:
I can't seem to figure this one out. Here is my class structure namespace name { public class foo { } }
3
by: JB | last post by:
My problem: I have an abstract class that implements an Interface: abstract class ReportBase: IReport { ..... Constructor and Code.... } On a user control I try to have it's class derive...
19
by: bubzilla | last post by:
Hi, i´ve got about 10 headerfiles with implemented classes. Now when i try to compile them i get the following message: In file included from Proxy/ServerCnx.hh:36, from...
2
by: bubzilla | last post by:
Hi, i´ve got about 10 headerfiles with implemented classes. Now when i try to compile them i get the following message: In file included from Proxy/ServerCnx.hh:36, from Proxy/Payload.hh:30,...
2
by: Steven T. Hatton | last post by:
This is not a big deal. It just bothers me that I don't see a way around including the header for QVariant in the following: #ifndef _XML_IMPL_INTERNAL_H_ #define _XML_IMPL_INTERNAL_H_ class...
4
by: rach | last post by:
I just started to learn C++. I copied the following code from a data structure textbook to a ".h" file and couldn't compile it. The code contains three template interfaces. One inherits another. The...
2
by: nospam | last post by:
Hello - I am getting a compile error "Expected class, delegate, enum". I am trying to create a Class Library in C# which wraps around an unmanaged DLL that manages a MIDI interface. In my...
52
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
10
Dököll
by: Dököll | last post by:
I don't want you nice guys to waste your too much of your time, and confused me in the process. I am hoping you can explain it to me like I am 2 years old, that's it. Hoping to get a handle...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.