Post Reply  Post Thread 
Newbie in Java
Author Message
vbarhoskie
Junior Member
**


Posts: 1
Group: Registered
Joined: Jul 2008
Status: Offline
Reputation: 0
Thank 0
0 was given thank in 0 posts
Post: #1
Newbie in Java

Gentlemen,

I need someone to help me in identifying whats wrong with my code? Whenever I try to compile it gives me errors?

I am new to programming and am still studying. Please help!

class ArithmeticOperations
{
int num1 = 12;//Declaring and initiallizing variables
int num2 = 5;
int a; int b; int c; int d;

public ArithmeticOperations()
{
a = num1 + num2;
b = num1 - num2;
c = num1 * num2;
d = num1 / num2;

}

public Void showData()
{
System.out.println("The sum of num1 and num2, is=");
return a;
System.out.println("The difference between num1 and num2, is=");
return b;
System.out.println("The product of num1 and num2, is=");
return c;
System.out.println("The result of dividing num1 by num2, is=");
return d;
}

public static void main(String args[])
{
ArithmeticOperations ao = new ArithmeticOperations();
ao.showData();
}

}



ADD TO DEL.ICIO.US  ADD TO DIGG  ADD TO FURL  ADD TO NEWSVINE  ADD TO NETSCAPE 
ADD TO TECHNORATI FAVORITES  Technorati ADD TO SQUIDOO  ADD TO WINDOWS LIVE  ADD TO YAHOO MYWEB  ADD TO ASK 
ADD TO REDDIT  ADD TO STUMBLEUPON  ADD TO GOOGLE   

07-17-2008 12:15 AM
Find all posts by this user Quote this message in a reply
lynwell07
Junior Member
**


Posts: 1
Group: Registered
Joined: Oct 2009
Status: Offline
Reputation: 0
Thank 0
0 was given thank in 0 posts
Post: #2
RE: Newbie in Java

Oops, I am no gentleman but a gentle woman that is why I can’t tell you whats wrong. Seriously, if the codes are just pre-built, the only solution is to check if you copied them correctly. And lastly, check your open and close parenthesis, I think something is missing.



_________________
Multivariate Testing



ADD TO DEL.ICIO.US  ADD TO DIGG  ADD TO FURL  ADD TO NEWSVINE  ADD TO NETSCAPE 
ADD TO TECHNORATI FAVORITES  Technorati ADD TO SQUIDOO  ADD TO WINDOWS LIVE  ADD TO YAHOO MYWEB  ADD TO ASK 
ADD TO REDDIT  ADD TO STUMBLEUPON  ADD TO GOOGLE   

This post was last modified: 12-01-2009 01:08 PM by lynwell07.

10-08-2009 03:06 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  The Complete Java 2 Certification Study Guide: Programmer’s and Developers Exams admin 0 656 07-20-2007 07:36 PM
Last Post: admin
  SCJP Exam for J2SE 5: A Concise & Comprehensive Study Guide for Sun Certified Java admin 0 661 07-20-2007 07:33 PM
Last Post: admin
  SCJP Sun Certified Programmer for Java 5 Study Guide, Exam 310-055 admin 0 797 07-20-2007 07:31 PM
Last Post: admin
  The Sun Certified Java Developer Exam with J2SE 1.4 admin 0 701 07-20-2007 07:29 PM
Last Post: admin
  Google Web Toolkit: GWT Java Ajax Programming admin 0 640 07-20-2007 07:28 PM
Last Post: admin
  Professional Java JDK 6 Edition admin 0 1,184 07-20-2007 07:24 PM
Last Post: admin
  The Definitive Guide to Java Swing, Third Edition admin 0 1,383 07-19-2007 11:43 PM
Last Post: admin
  Beginning Java Objects: From Concepts To Code, Second Edition admin 0 758 07-19-2007 11:42 PM
Last Post: admin
  Java Programming with Oracle JDBC admin 0 666 07-19-2007 11:41 PM
Last Post: admin
  Professional Eclipse 3 for Java Developers admin 0 601 07-19-2007 11:40 PM
Last Post: admin

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: