|
-
Aug 15th, 2001, 12:43 AM
#1
Thread Starter
New Member
Learning java!!!
A message was posted in this forum asking how to learn java.
Well i do know something about java but the problem is i know far less than i require.
There are so many java related technologies and i am learning java all by myself . Many people scare me that there is too much to cover in java world that its simply is impossible. Is it true ?
Or got any tips??
-
Aug 18th, 2001, 08:26 PM
#2
Lively Member
I too am learning java. I am reading a book called Beginning Java 2 (JDK 1.3 edition). I have read about 150 of 1200 pages. Seems to be pretty good so far although I am moving more slowly through this book than any other book I have read on any programming or scripting language.
-
Aug 23rd, 2001, 08:34 PM
#3
hi :)
I will learn Java at school and I will have to buy a book. I think is the best way to have a base but the best is to try and do error We learn so much with our error but of course you need a base to start. I suggest you to buy a book. 
Cya
-
Aug 23rd, 2001, 11:32 PM
#4
Dazed Member
I think the best thing to do is learn the base of the language first. Operators and assignments. Flow control. Exception handling ect.... Learn the API. You dont have to necessarily memorize every method of every class but know what packages are use for what and just memorize some of the most common methods in some of the classes.
Learn the concepts of OOP. For instance "A class models an abstraction by defining behaviors and properties for the objects represented by the abstraction" Understand about inheritance
Overriding vs. Overloading. Variable shadowing. Then classes. Innerclasses, Localclasses ect......
Get the concepts down and everything will be eaiser to learn after that.
There is a lot to learn but it all matters what you want to do with the language. Do you want to work primarily with Databases? Do you want to program for wireless diveces? Such as the new
(Nextell Moterola i85s phone) Maybe you want to be a game programmer. There is no doubt that there is a lot to learn but as you get further then stuff becomes more generlized into specificaly what you want to do and should focus on.
-
Aug 24th, 2001, 03:07 AM
#5
Lively Member
what is variable shadowing
-
Aug 24th, 2001, 07:53 AM
#6
Member
I'm guessing either something he made up to sound like an OOP expert , or using private variables with accessor functions.
-
Aug 24th, 2001, 11:17 AM
#7
PowerPoster
There are a lot of good websites that give downloadable applets. I learned a lot by just looking at the code for those. Also, if you get a good IDE like JBuilder, it will usually have great documentation that you can help a lot.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Aug 24th, 2001, 02:10 PM
#8
Dazed Member
Filbert1 no offence but if you dont know what variable shadowing is then you dont understand OOP. But i think you are just kidding.
-
Aug 24th, 2001, 02:12 PM
#9
Dazed Member
I'm guessing either something he made up to sound like an OOP expert , or using private variables with accessor functions.
I think that would be more along the lines of Encapsulation.
-
Aug 24th, 2001, 02:32 PM
#10
Lively Member
enlighten me as to what it means please
-
Aug 24th, 2001, 02:54 PM
#11
Dazed Member
A subclass cannot override variable members of the superclass but it can however shadow them, be defining variables with the same name. A subclass method can use the keyword super to access inhereted members, including shadowed variables.
-
Aug 24th, 2001, 03:08 PM
#12
Lively Member
ok thats what i thought it meant. is shadowing a common term?
-
Aug 24th, 2001, 03:13 PM
#13
Dazed Member
pretty much. I guess. I only know Java which is OOP. Visual Basic
has the ability to define classes but i never really have a need for them. I always just use standard modules(.bas) vs. class modules (.cls). How long have you been programming? And what languages do you know? which ones do you like?
-
Aug 24th, 2001, 04:01 PM
#14
Lively Member
only vb and php and now java
-
Aug 24th, 2001, 04:03 PM
#15
Lively Member
the reason why i want to learn java is mainly servlets and jsp but i figure i might as well learn to program some windowed apps
-
Aug 24th, 2001, 04:22 PM
#16
PowerPoster
yeah, wait till you learn javabeans, their awesome
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Aug 24th, 2001, 04:26 PM
#17
Lively Member
-
Aug 24th, 2001, 04:39 PM
#18
Dazed Member
Is a servlet the same as a javabean? I have no clue. I really havent gotten that into the server aspect of Java. Im still focusing on the core language and Swing.
-
Aug 24th, 2001, 05:11 PM
#19
Lively Member
sorry , i meant is EJB the same as a javabean?
-
Aug 24th, 2001, 05:12 PM
#20
Lively Member
does anyone post on the sun forums?
-
Aug 24th, 2001, 05:20 PM
#21
New Member
Free Java intro class for VB developers
I'm currently working on an intro to Java programming class that is specifically targeted at VB developers. The course takes an approach to learning Java that works for someone who knows VB (and doesn't know other strict OO languages like C++). Points out parallels and contrasts between VB and Java, etc.
I'm developing this course for Sun, and they're holding a ~free~ Beta pilot class in Pleasanton, CA, October 8-12. The class is 5 days.
I'd love to get some feedback from the VB community on this course. If you're interested in attending, drop me a line at [email protected].
-Dave
-
Aug 24th, 2001, 08:38 PM
#22
Member
Originally posted by Randy_Bartels
does anyone post on the sun forums?
Even more frequently than they post here. And there are TONS of different forums there too. But not as many features as vBulletin, of course.
-
Aug 25th, 2001, 12:20 AM
#23
Dazed Member
Randy_Bartels......... Yeah i post there sometimes. I give all of my duke dollares away. (not really ) You will notice two kinds of people there. The ones who know there sh*# and the ones who dont know sh$!.... {{{laughing}}} no but seriously i think suns has a really good complex of forums on their site.
-
Aug 25th, 2001, 12:10 PM
#24
PowerPoster
Borland also has some great community forums.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Aug 25th, 2001, 04:18 PM
#25
Lively Member
i'm having problems understanding the following code:
public class Point
{
// Create a point from its coordinates
public Point(double xVal, double yVal)
{
x = xVal;
y = yVal;
}
// Create a point from another point
public Point(Point point)
{
x = point.x;
y = point.y;
}
// Convert a point to a string
public String toString()
{
return x+","+y;
}
// Coordinates of the point
protected double x;
protected double y;
}
public class ListPoint
{
// Constructor
public ListPoint(Point point)
{
this.point = point; // Store point reference
next = null; // Set next ListPoint as null
}
// Set the pointer to the next ListPoint
public void setNext(ListPoint next)
{
this.next = next; // Store the next ListPoint
}
// Get the next point in the list
public ListPoint getNext()
{
return next; // Return the next ListPoint
}
// Return String representation
public String toString()
{
return "(" + point + ")";
}
private ListPoint next; // Refers to next ListPoint in the list
private Point point; // The point for this list point
}
public class PolyLine
{
// Construct a polyline from an array of points
public PolyLine(Point[] points)
{
if(points != null) // Make sure there is an array
{
// Create a one point list
start = new ListPoint(points[0]); // 1st point is the start
end = start; // as well as the end
// Now add the other points
for(int i = 1; i < points.length; i++)
addPoint(points[i]);
}
}
// Construct a polyline from an array of coordinates
public PolyLine(double[][] coords)
{
if(coords != null)
{
// Create a one point list
start = new ListPoint(new Point(coords[0][0], coords[0][1]));
// First is start
end = start; // as well as end
// Now add the other points
for(int i = 1; i < coords.length ; i++)
addPoint(coords[i][0], coords[i][1]);
}
}
// Add a Point object to the list
public void addPoint(Point point)
{
ListPoint newEnd = new ListPoint(point); // Create a new ListPoint
if(start == null)
start = newEnd; // Start is same as end
else
end.setNext(newEnd); // Set next variable for old end as new end
end = newEnd; // Store new point as end
}
// Add a point to the list
public void addPoint(double x, double y)
{
addPoint(new Point(x, y));
}
// String representation of a polyline
public String toString()
{
StringBuffer str = new StringBuffer("Polyline:");
ListPoint nextPoint = start; // Set the 1st point as start
while(nextPoint != null)
{
str.append(" "+ nextPoint); // Output the current point
nextPoint = nextPoint.getNext(); // Make the next point current
}
return str.toString();
}
private ListPoint start; // First ListPoint in the list
private ListPoint end; // Last ListPoint in the list
}
public class TryPolyLine
{
public static void main(String[] args)
{
// Create an array of coordinate pairs
double[][] coords = { {1., 1.}, {1., 2.}, { 2., 3.},
{-3., 5.}, {-5., 1.}, {0., 0.} };
// Create a polyline from the coordinates and display it
PolyLine polygon = new PolyLine(coords);
System.out.println(polygon);
// Add a point and display the polyline again
polygon.addPoint(10., 10.);
System.out.println(polygon);
// Create Point objects from the coordinate array
Point[] points = new Point[coords.length];
for(int i = 0; i < points.length; i++)
points[i] = new Point(coords[i][0],coords[i][1]);
// Use the points to create a new polyline and display it
PolyLine newPoly = new PolyLine(points);
System.out.println(newPoly);
}
}
the output is:
Polyline: (1.0,1.0) (1.0,2.0) (2.0,3.0) (-3.0,5.0) (-5.0,1.0) (0.0,0.0)
Polyline: (1.0,1.0) (1.0,2.0) (2.0,3.0) (-3.0,5.0) (-5.0,1.0) (0.0,0.0) (10.0,10.0)
Polyline: (1.0,1.0) (1.0,2.0) (2.0,3.0) (-3.0,5.0) (-5.0,1.0) (0.0,0.0)
I dont understand how the getNext method actually gets the next point.
-
Aug 25th, 2001, 10:31 PM
#26
New Member
In PolyLine's constructors:
start = new ListPoint(points[0]); // 1st point is the start
end = start; // as well as the end
So start and end now point to the same object. Then, in addPoint, you call:
end.setNext(newEnd); // Set next variable for old end as new end
But the first time you call addPoint, start and end point to the same object, so start.next now refers to the new point:
start.next = point1
You then set end to refer to point1, so the next time you call addPoint, you get:
point1.next = point2
And so forth.
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|