Java Definition and 587 Threads

  1. Theia

    Java Why Choose Java: Reasons to Learn Java Programming

    I've been wondering a while what are the reasons I should learn Java programming language. Thus far I've mainly seen someone saying how cool Java is and how it is this and that. But. I haven't found it 'cool', or to be honest, useful at all (and I could state that Fortran is cool...). Being...
  2. S

    Java Java Help with Methods: Solve Your Method Struggles

    I am having a difficult time with methods in java. I've been able to get my program to run correctly without methods. My for loop does as intended by printing an alternating rectangular pattern with no separator at the ends. However, after trying to decompose my code into 3 methods I've hit a...
  3. G

    Java Almost all older useful (physics) java applets blocked

    Hi. I have lots of bookmarks to splendid physics Java applets, but most of them are a bit dated. Many of them get blocked by current Java versions. To make them work I have to go to the Windows control panel, open Java control panel, add the page to the exception site list and restart the...
  4. M

    Comp Sci Java Programming Homework: Create Sandwich & TestSandwich Classes

    Homework Statement I decided to take a Java class so I can introduce my students to programming/java next year as part of an after school program. I am stuck! My code works except for the last part. It is in bold. Honestly, I am lost. I'm sure it is a simple solution but I can't see it. Any...
  5. J

    Java A little clique "game" in Java - Clique Problem

    For what it's worth, i created a little java program in relation to the clique problem https://en.wikipedia.org/wiki/Clique_problem The idea was, to play around with it and maybe discover some better algorithm than the known ones used to discover all maximum cliques The code is quite small...
  6. levadny

    Java Java GUI Development: SWING vs. Other Libraries

    Dear friends! Please explain me what API/Libraries uses in Java for create graphic user interface. I use SWING but I hear that SWING is oldest technology. What you uses?
  7. Docscientist

    Java Learn Java Programming: Fast and Comprehensive Tutorials

    I was searching for a good website or an app that can teach Java.I found so many of them and they were pretty uninteresting.They don't teach from the scratch and I get so annoyed.And even in those videos that start from the scratch,it is very very slow that I feel why can't the teacher be...
  8. Euler2718

    Java Multiple Inputs and Writing to .txt

    Essentially, my problem is to: design a program that takes the following information: -a persons ID -a houses ID -listing price of house -selling price of house and write the input to a text file, called Sales.txt. Secondly, based on the list and selling price, commission is calculated based...
  9. V

    Interested to learn Physics, But I don't know what to learn

    I like to learn Physics related to my career. I'm a software Engineer with good development experience in Java. Looking to find ways how can I use Java with Physics
  10. T

    Java Can compareTo Handle All String Comparisons in Java?

    I can't get this to test all the way through import java.util.Scanner; public class OrderStrings { public static void main (String [] args) { String firstString; String secondString; firstString = "rabbits"; secondString = "capes"; if...
  11. T

    Java What are some open source projects for gaining experience with Java?

    Hello everyone. I am a computer science and applied math double major. I want to get involved in an open source project so I can gain experience and so I have something to show potential employers that I worked on. I just created a GITHUB account and I am not an expert at using it, nor have I...
  12. D

    Comp Sci [JAVA GUI] Counting the trajectory of a projectile not shown

    Hello PFers, I'm trying to make a program in java which process user's position, initial velocity of the projectile and the elevation of the projectile and show the trajectory in GUI. The language is in java. The problem is, the trajectory won't show. It is supposed to show the player's...
  13. V

    Java Which Programming Language is Better for Web Development: PHP or Java?

    Dear Friends, I am new here and I would like to ask you for an advise. I have the opportunity to start a scholarship with a good school with Cambridge International Certificate. At this school I have opportunity to choose one of two modules: PHP Web Development or Java Development. I worked...
  14. Mr Davis 97

    Java Why is type casting different in Java and Python?

    I am writing code in both Java and Python, and am a little confused about one thing: casting. In Python, we cast data types by using int(), str(), float(), etc. These are functions which convert one data type to its representation as another data type. However, in Java, it doesn't work like...
  15. N

    Java Understanding basics of computer programming

    I am having some issues understanding the fundamentals of Java and OOP. In simplest terms possible with an example can you explain to me what an Object, Class and Method are? I am confused on what these actually are. Thank you
  16. O

    Continuing Ed - Learn Java or Visual Basic

    Hey all, So I just graduated community college with an associates degree. The program is essentially a chemical technician program. I'm currently employed at an agricultural company, but the job is not very mentally stimulating. I was thinking of pursuing a continuing education program...
  17. D

    Java Java- Set hasDigit to true if the 3-character passCode contains a digit.

    Been working this problem for hours and can't seem to get it right. Any assistance would be greatly appreciated! Note: Green colored text is the editable text public class CheckingPasscodes { public static void main (String [] args) { boolean hasDigit = false; String passCode =...
  18. N

    Comp Sci Java Error: "Type Mismatch" Explained

    I am programming in Eclipse and I keep seeing the error " Type mismatch: cannot convert from int to String", not only in the example I am going to provide but other programs. I've just started programming in Java. Could someone explain to me what this error exactly means? publicclassPracOne{...
  19. D

    Java Java Programming Boolean if-else statement

    Looking for some assistance with this. I've been messing with this for hours and can't seem to get it right. Some assistance would be greatly appreciated. What I have below is not correct. Material in green cannot be changed. Thanks!Print "Balloon" if isBalloon is true and isRed is false. Print...
  20. TheMathNoob

    Comp Sci Why does this method execute? JAVA

    Homework Statement package myfirstgame; import javax.swing.JFrame; import java.awt.Graphics; /** * * @author danif */ public class MyFirstGame extends JFrame { public MyFirstGame() { setTitle("the game"); setSize(250,250); setResizable(false); setVisible(true)...
  21. N

    Unable to get into Java based intro course, might CLEP?

    I spoke with my adviser about this he said "have you ever programmed in Java before? because you could CLEP out into the following course" I told him I have programmed very little in Java. Now my life was a bit shattered when I realized the wait-lists for this class were too much to get in. So...
  22. Silicon Waffle

    Java [Java] Make a musical note without using any external library

    :oldsmile:Do you know how to make a musical note in Java without using any external library ? In C# I can simply do this : Console.Beep(50,1000); //play a sound at 50Herz of frequency within 1 second
  23. V

    Comp Sci 2D collision detection / determining final velocity - Java

    Homework Statement Determine if two circular objects (both moving or one stationary), collide and if so, determine their final velocity. The two objects are being rendered using Graphics's Java library class, updating their position 60 times per second. Their position (x,y) is determined based...
  24. Essence

    Java Defining variables in the context of implicit functions in java

    Sorry for the disturbance, So I have been looking (without success) for a way to define a variable within an implicit function in Java. What I really mean by this is I have the equation: In this function my program will give me all of the values except for px. I have tried rearranging the...
  25. Domenico94

    Learning Java and C++ for Job Opportunities

    Hi everyone... I'm a communication system engineering student and in my university we use studying Java. Now, for this summer, when I ll have free time, I was thinking about doing some practice with programming and maybe studying a new language, such C++( it s still a widesprrad language and I...
  26. iamjon.smith

    Java Serialization/Deserialization of objects in Java

    Ok guys, I am working on a simple serialize/deserialize project. A user interface takes the following input: A Department ID (INT), A Department Name (String), and Three Employees (ArrayList) that have a Name, Department, and Salary. Once the Three employees are entered, the Department can be...
  27. R

    Junior Java Developer in Test: Interview Questions & SQL/Java Practices

    I applied at an internship for the position of a Junior Java Developer in Test and I am wondering if you can provide me some screening question examples? The internship requires that I have strong knowledge in SQL and Java. I asked the recruiter to elaborate on the technical interview questions...
  28. O

    Java Help coming up with a program idea

    Hello, I have a working calculus library for java and want to use it in a program. I don't have very many ideas. I have limited Calc. II knowledge but a strong understanding of Calc. I. I have an intermediate understanding of java (took 3 courses at my high school of it), and a solid algebraic...
  29. P

    Java Representing long decimals in hex in Java

    Does anyone know how to represent the following (example) base 10 number as hexadecimal in the Java language...
  30. P

    Java Is secure deletion possible in Java

    Let a file on disc comprise the bytes "Hello World". If I open the file in Java as a RandomAccessFile and write the character "X" over it from the start of the file to it's end, will the original disc block be overwritten? Or, will the original block containing "Hello World" be marked as...
  31. D

    Java Eigenword embeddings and spectral learning; I'm a beginner....

    Hi everyone, I am a mathematics undergraduate and I'm currently doing an internship at the informatics department of a university. I am well and truly out of my depth. My supervisor has assigned me tasks which include Java (a language I'm having to quickly pick up, having only used python/R)...
  32. R

    Comp Sci Java Fibonacci Sequence: Finding the Sum of Even-Valued Terms Under 4 Million

    Homework Statement Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million...
  33. S

    Comp Sci Showing that matter has an atomic nature using Java program

    Homework Statement http://pastebin.com/aS3vTR2V Homework Equations N/A The Attempt at a Solution I'm confused about what I need to do for the BlobFinder constructor. Someone told me that I should “initialize the ArrayList blobs”, then “create a 2D array of booleans called marked, having the...
  34. R

    Java Junior Java Interview Questions -- What to Expect?

    I am applying for a junior java internship and the recruiter told me there is going to be a math based interview question that I must code. What can I expect from this math based question? Are there general math questions that you can provide me so that I will have a good understanding of what...
  35. F

    Java Solve Confused Java HW: Generate 225 Samples Size 625 Random Nos U(10,22)

    Generate 225 samples of size 625 random numbers from U(10,22). For each of these 225 samples calculate the mean. a) Find the simulated probability that the mean is between 10 and 11. b) Find the mean of the means. c) Find the standard deviation of the means. d) Draw the histogram of the...
  36. T

    Comp Sci How to Save and Sort a List of Historical Events in Java?

    Homework Statement You are provided the following list that contains (semi-random) years from modern history. Save the list to a text file named “events.txt” Write a program that: 1. Reads in the file “events.txt” 2. Sorts it with the latest events first 3. Determines whether the founding of...
  37. R

    Comp Sci Java Implementing Singly Linked List

    Homework Statement I am implementing a singly linked list but when I am in my main method, to add into my singly linked list, nothing happens.Homework Equations [/B] None The Attempt at a Solution I am trying to implement a singly linked list. My singly linked list, where I implemented a...
  38. M

    Java NullPointerException error in Java (Eclipse)

    class Cellphone { private String brand; private long serialNumber; private double Price; public Cellphone (String br, long sN, double Pr) { brand= br; serialNumber = sN; Price = Pr; } public Cellphone(Cellphone aCellphone)...
  39. R

    Comp Sci Java: Set Interface Homework - Avoid Overriding Methods

    Homework Statement If I have a subclass that implements a set class how can I avoid having to override all the set classes methods? Homework Equations None The Attempt at a Solution I have an interface: import java.util.Set; /** * An extended Set where there is added...
  40. icecubebeast

    Java How do you handle multiple statements in Java's for loop?

    Hello, I haven't used the for loop in Java much, so I have a question. How do you put multiple statements inside the initialization, condition, and iteration portions of the for loop? I was coding and I came across this error: Exception in thread "main" java.lang.Error: Unresolved compilation...
  41. M

    Java [Java] Did I write this program correctly? Please check

    Write a Java program to find the sum of all numbers between 1 to 10. So we all know that 1+2+3+4+5+6+7+8+9+10=55 and that answer to this problem is 55. Please check my work below: public class Standard { public static void main(String[] args) { // Create a for...
  42. R

    Comp Sci How to Implement Union Method in Java Interface?

    Homework Statement How do I take the union between an object called on and the object passed in the parameter? Homework Equations None The Attempt at a Solution I have an interface: import java.util.Set; /** * An extended Set where there is added functionality * *...
  43. T

    Comp Sci 100 Lockers Problem Java Program

    . Homework Statement A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first student, denoted S1, opens every locker. Then the second student, S2, begins with the second locker, denoted L2, and closes every other locker...
  44. R

    Comp Sci How can I redefine the FileNotFoundException in Java for my class practice?

    Homework Statement I want to redefine the FileNotFoundException by creating a new class which extends it, but I am having difficulty. For my class practice, if no file is selected or passed in, an UnknownFileException should occur. Homework Equations None The Attempt at a Solution My code...
  45. M

    Java Help with a pattern using nested loops (java)

    Hey so I have to make a pattern in the shape of a diamond as follow: 1 123 12345 123 1 So first, I wrote the code without using a variable n as the number of rows ( from an input from the user) but just the constant i = 5 ( I am sorry for the variable names, I made many patterns and...
  46. R

    Comp Sci Java: Reading a file into an array

    Homework Statement How do I read in a file line by line into an array without using arraylist? Homework Equations NoneThe Attempt at a Solution I know how to do this using BufferedReader, but I am wondering how to do this using Scanner? When I used BufferedReader I noticed that there must...
  47. R

    Java How to Incorporate a Numerical Solution into a Physics Java Applet?

    Homework Statement [/B] I would like to make a physics applet. I have a numerical solution of the Lotka-Volterra model located here: https://www.physicsforums.com/threads/lotka-volterra-model-eulers-method.803382/#post-5044961 Homework Equations None The Attempt at a Solution [/B] I want...
  48. SmokeyMTNJim

    Java Why Are Java Applets Blocked Despite Being Added to Exception List?

    I am trying to view some possibly old java applets on this site: http://aleph0.clarku.edu/~djoyce/java/elements/bookI/bookI.html I keep getting promoted that they are blocked. I have tried to add this site to the exception list but it has not changed anything. I closed all pages, and have since...
  49. R

    Java How do I create an instance of a class in a method using Java?

    Homework Statement How do I create an instance of a class in a method? Homework Equations None The Attempt at a Solution I am a bit rusty whenever I think of instances. I always think of main method and objects when I see instance which gets me confused on what to do with the following...
  50. R

    Comp Sci Java Subclass Method for Cashier and Clerk: Solving a Competition Challenge

    Homework Statement Suppose I have a subclass called, Cashier, and a super class named, Clerk. How do I make a method that is called on a Cashier object and takes in an instance of Cashier? What method has a structure like this? Homework Equations NoneThe Attempt at a Solution This method is...
Back
Top