171 Posted Topics

Member Avatar for Dante2

Yes. It is quite possible. In fact, it's been done several times. See: [url]http://en.wikipedia.org/wiki/JavaOS[/url] As a practical matter, it can't be 100% Java. There needs to be some kind of bootstrap or microkernel for the lowest level stuff to build upon. But one can make an operating system that is …

Member Avatar for JeffGrigg
1
404
Member Avatar for chiiqui

GUI skills will get you a job now. The industry is heading quickly towards a major concurrency problem -- lots of cores vs mostly single-threaded code. If someone can find good answers to that problem, they could be very successful! ;->

Member Avatar for chiiqui
0
399
Member Avatar for rotten69

[QUOTE=rotten69;1619165]OK. I have awesomely solved this problem. The answers to both sub-questions are ZERO.[/QUOTE] Congrats! You have done your homework. It thinking like that the could just lead to... Math on two's complement representations of numbers. >;->

Member Avatar for rotten69
0
266
Member Avatar for nickliutw

You have compile errors in your 'addStudent()' method because it's inside the 'main' method. It needs to be between the two closing braces ('}') at the end. Once you fix that, you'll want to change the last two '.nextLine()' calls, as you did in the copy of the code above …

Member Avatar for nickliutw
0
152
Member Avatar for chamnab

@chamnab: What's most important in these problems is to break a big problem down into smaller problems. Starting with that we want to produce this output: [CODE] 1 1 2 3 4 5 1 1 1 1 2 3 4 1 2 1 1 2 1 1 2 3 1 …

Member Avatar for Onlineshade
-2
81
Member Avatar for supriya badam

[LIST] [*]"retrun" is misspelled; it should be "return". [*]"wats" is misspelled; it should be "What's the" or "What is the". [*]"plz" is misspelled; it should be "Please". [/LIST]

Member Avatar for JeffGrigg
0
352
Member Avatar for coco24

(Sorry; I posted without seeing the second page. Gosh the code has gained some new problems on the 2nd page. ;-) [LIST] [*]Try entering 'two three space enter'. See what happens. [*]You need to know exactly what [ICODE]tempString.substring(j, j)[/ICODE] is returning. This is a trick that I use: [ICODE]System.out.println(tempString.substring(j, j) …

Member Avatar for Onlineshade
0
154
Member Avatar for vishal1949

[LIST=1] [*]Use the same code tag to end the code section as you used to start it. (That is, use CODE at the end, not ICODE.) [*]Your main method, as given, does [B]not[/B] cause a stack underflow condition. Do you know how to make a stack underflow occur? [*]I think …

Member Avatar for JeffGrigg
0
450
Member Avatar for Nathan_11

Try this: [CODE]public class Hei { public static void main(String[] args) { int s = 0; for (int i = 0; i < 5; i++) { System.out.println("i = " + i); System.out.println(" s = " + s + " before the assignment statement"); s = 2 * s + i; …

Member Avatar for JeffGrigg
0
127
Member Avatar for nera1981

Some hints: [LIST] [*]The word "void" is how you say "this method does not return anything." [*]Returning the right thing is actually very easy. You're almost there. [*]The trick will be that every path through the method will need to either return something or throw an exception. Using "return null;" …

Member Avatar for nera1981
0
158
Member Avatar for GeekInTraining

See [url]http://en.wikipedia.org/wiki/Recycle_Bin_(Windows)#Physical_storage_locations[/url]

Member Avatar for JeffGrigg
0
61
Member Avatar for warlord902

Correct: It's an operating system issue, not a language issue. And pretty much all operating systems work this way. And C/C++ won't be any faster at doing this than Java. Really, If you intend to do that a lot, inserting of characters/lines "in the middle of" text files quite often, …

Member Avatar for warlord902
0
2K
Member Avatar for zhackon

And it helps to know that Bayanihan Linux is based on the Debian distribution, which is popular and well supported. So everything in the general Linux list above should work. This means... [I]you have [B]a lot[/B] of options![/I]

Member Avatar for zhackon
0
58
Member Avatar for SurrounD

This line [CODE]Puzzle[][] puzzle = new Puzzle[4][4];[/CODE] means that each cell in the 4x4 grid is a "Puzzle". So you have 16 "Puzzle" instances. This may not be what you want. You want to have a 4x4 grid of something. What is the thing you want for each cell in …

Member Avatar for SurrounD
1
144
Member Avatar for singh_soorma94

[I]A number of posts to this forum contain code samples that are, unfortunately, over 250 lines. :([/I] For something small that is used in high performance production applications, I'd suggest "WAX", a Java "Writing API for XML." [url]https://code.google.com/p/waxy/source/browse/[/url] Click on directories to navigate: trunk, trunk, java, src, com, ociweb, xml …

Member Avatar for sirlink99
0
161
Member Avatar for janice91

I could do it without an array. Can you? :-/ javaAddict is correct that there are issues with the formula in the computeBMI method. Get the rest of it working, and then the issues will be apparent.

Member Avatar for JeffGrigg
0
2K
Member Avatar for janice91

Suppose you created an instance of the class Human, and gave them a name: [CODE] Human h = new Human(); h.name = "Adam"; System.out.println("Hi! My name is " + h.getName());[/CODE] If you then called one of the "change name" methods in your example, how could you see this person's name?

Member Avatar for JeffGrigg
0
198
Member Avatar for Nathan_11

If you had the binary number '11100000', could you work out its decimal value yourself, with a pencil and a pad of paper? If you program a computer to do something similar, you will get a value stored in an 'int' variable, which you can print. (And it will, by …

Member Avatar for JeffGrigg
0
291
Member Avatar for anjoz

You'll probably want to split the string based on the directory separator character ("/"). If it starts with "/" then you'll want to start with the root directory ("/"); otherwise start with the current directory ("."). Look at the "listFiles" methods on the java.io.File class. The one that accepts a …

Member Avatar for griswolf
0
187
Member Avatar for vishal1949

Interfaces and classes must be [B]outside[/B] of method bodies. [CODE]public class CarsDescription { /** * @param args the command line arguments */ public static void main(String[] args) { } interface Domestic {} interface Import {} interface Japanese extends Import {} interface German extends Import {} interface Detroit extends Domestic {} …

Member Avatar for Ezzaral
1
350
Member Avatar for sirin_adam

Yes: It is important to [B]always[/B] compare strings using the '.equals' method -- not the '==' operator. [I](And in Java, the convention is to start method names with a lower case letter. ;-)[/I] There is something to be said for doing the string comparisons like this: [CODE] public static void …

Member Avatar for sirin_adam
0
171
Member Avatar for aiwasen

People will hate me for saying this, but I recommend starting in Microsoft Windows because it's so commonly used. Personally, I know and like Unix/Linux, but I have to admit that the learning curve is steeper for that than Windows. Also, like it or not, Microsoft is doing the best …

Member Avatar for Rashakil Fol
0
255
Member Avatar for bibiki

Well actually, the "WEB-INF" means "don't let end users browse to this folder and download any files from it." As for "data services," I might suggest... [LIST] [*]SOAP libraries [*]"Web Services" [*]possibly "restful web services" [*]possibly JSON format data (instead of SOAP) [/LIST] There are a great many things that …

Member Avatar for bibiki
0
93
Member Avatar for nomin-ginger

See [url]http://download.oracle.com/javase/6/docs/api/java/lang/String.html#substring(int, int)[/url] The '.length()' method will also prove useful.

Member Avatar for sathya88
0
316
Member Avatar for abhinavM

I suspect that a more appropriate approach would be to create a single variable that is an 'ArrayList<String>' before the loop, and then call '.add(String)' in the loop.

Member Avatar for Majestics
0
12K
Member Avatar for Armanious
Member Avatar for JeffGrigg
0
153
Member Avatar for chixm8_49

It's a pragmatic issue, really: You can't do much with a pointer unless you know something about the structure of what it points to. And if you get it wrong, you typically corrupt your data and you can very easily crash the program. PASCAL allows you to overlay pointers using …

Member Avatar for chixm8_49
0
104
Member Avatar for techie1991

[LIST=1] [*]If root is null, is the tree symmetrical? [*]If the root node exists, but it has no children, is it symetrical? [*]If the root node exists, and it has a left child but no right child, is it symmetrical? [*][I](The rest left as an excercise for the student. :-/)[/I] …

Member Avatar for JeffGrigg
0
140
Member Avatar for kehayov

Your [ICODE]for (;;)[/ICODE] statement is just fine. It works just like [ICODE]while (true)[/ICODE]. To answer your original question: You get so many prompts because 'System.in' does not and cannot give you character-by-character input. It can only read a line at a time. It's getting input a line at a time, …

Member Avatar for JeffGrigg
0
163
Member Avatar for Aviras

Generally the way multi-user Internet games work is that each client connects to the server(s) on port 80 with the HTTP protocol. This is the only reliable way to get through firewalls from arbitrary clients. In particular, in general you cannot connect to clients: Servers cannot open connections to clients. …

Member Avatar for Aviras
0
287
Member Avatar for afaquemanzoor

Ohhh... [LIST=1] [*]It seemed like a good idea at the time. [*]You got a problem with that?!? [*]Really, it can interpret or compile the byte code, depending on its mood. [*]Generally, these days, the JIT (Just-In-Time) compiler does compile the byte code to machine language. [/LIST]

Member Avatar for JeffGrigg
0
113
Member Avatar for MA1779

That's a really nice homework assignment. You need to design and implement it, as you have done with the GUI. If you have any specific questions or issues regarding the code [U]once you have designed and implemented it[/U], we'd be glad to help.

Member Avatar for peter_budo
0
142
Member Avatar for avinash_545

Companies that integrate with ERP systems can afford to hire expensive experienced consultants. :twisted:

Member Avatar for JeffGrigg
0
74
Member Avatar for sachinpkale
Member Avatar for JeffGrigg
0
175
Member Avatar for D3X

(I took some context from the thread at [url]http://www.daniweb.com/software-development/java/threads/377186[/url] ) What makes you think that it is not working?

Member Avatar for JeffGrigg
0
131
Member Avatar for jnewbie

You might be over-thinking this. Relax. Take it a step at a time. To answer your question... If you have an ArrayList containing "mars snickers", "mars M&Ms" and "mars caramel" then you might want to loop through the elements of the list and print each one. Note that "item #1" …

Member Avatar for JeffGrigg
0
125
Member Avatar for yumyam09
Re: Hi!!

Note: If saving money is the objective, then leave the computer on all the time. Modern computers automatically go into "power saving" modes when unused. But powering them on and off over time causes thermal stress, causing them to fail. So you save money by leaving them on all the …

Member Avatar for JeffGrigg
-1
80
Member Avatar for betny

Hint: "One of these things is not like the others. One of these things does not belong. ..." :P [CODE] public void readArguments( readArray) { ... public int countArguments( String args[] ) { ... public static void main( String[] args ) { ...[/CODE] [I](...or really, one of them could be …

Member Avatar for betny
0
393
Member Avatar for farhanrocks

Provide some way to make multi-threaded programming brain-dead easy and safe for business programming on the JVM. Scala wouldn't be a bad choice for language. Heck, if you really pulled it off, [B]you[/B] could be the next big thing in the industry. You'd have just solved one of the biggest …

Member Avatar for Rashakil Fol
-3
287
Member Avatar for Amr87

[QUOTE=Amr87;1622586]3- what distinguish a web developer from another rather than having wide set of programming languages?[/QUOTE] Short term, the particular tools and libraries you know make more of a difference. But you can't build a career out of that. The tools, libraries and technologies people are using change dramatically over …

Member Avatar for Amr87
0
79
Member Avatar for ssai

Am I correct in assuming that the regular expression like pattern "A+B*C" means "one or more strings each containing the letter 'A', followed by zero or more strings each containing the letter 'B', followed by one string containing the letter 'C'."? So "AC" would match '[1] ACD, [2] BC'. And …

Member Avatar for ssai
0
200
Member Avatar for ithelp
Member Avatar for Haridha

Following NormR1's link, here's the official list: [url]http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.9[/url] Now going through this list and figuring out the usage of each of them can be a very interesting and educational exercise for the student. ;->

Member Avatar for stultuske
-2
106
Member Avatar for srdva59

If you want to create something like DNS, then it may be helpful to know how DNS works. See... [url]http://en.wikipedia.org/wiki/Domain_Name_System[/url]

Member Avatar for JeffGrigg
0
49
Member Avatar for tubby123

Keeping a sorted list/tree of k values would be O(n log k), I think. If someone asserts that k is a constant, making this O(n), then I'll assert that for any given run, n is a constant, so it's really O(1). ;->

Member Avatar for JeffGrigg
0
143
Member Avatar for ranu jain

It's possible to be inspired by the way Java solves the problem in HashMap. They create a class: [url]http://download.oracle.com/javase/6/docs/api/java/util/Map.Entry.html[/url]

Member Avatar for JeffGrigg
0
183
Member Avatar for carloskire

If this code runs on a Unix box, it occurs to me that one of the directories or the file itself might not be readable by the "user" the process is executing as. Try giving everyone read access to the directories and file. On the other hand, you did mention …

Member Avatar for carloskire
0
505
Member Avatar for hamiltino

This is homework. You should write the code. You'll learn better that way. A hint to help you get started: Consider the relationship between [icode]int power[/icode] and the LinkedList index. Doing this might inspire a really good idea.

Member Avatar for JeffGrigg
0
208
Member Avatar for mexabet

I most highly recommend... [B]Write the whole thing in Jython.[/B] [I](Jython is the version of Python that runs on the Java Virtual Machine (JVM))[/I] If you are successful enough to have performance problems, then... [LIST=1] [*]Optimize the Jython/Python code. [*]Consider upgrading to Java 7. [*]Convert only a few key performance …

Member Avatar for JeffGrigg
0
297
Member Avatar for J-Dub

The "tie" logic is buggy. Play several games in a row; you'll see. [I](I know what's causing this bug, but I'll let you debug it as an exercise for the student. ;-)[/I]

Member Avatar for peter_budo
0
437

The End.