Question

In: Computer Science

Print "Hello World" in the most complicated way (java)

Print "Hello World" in the most complicated way (java)

Solutions

Expert Solution

Solution

Screenshot

Code

class HelloText implements Runnable
{
public void run(){
char l = ' ';
char[] h = new char[6];
int o = 0, m = 0, n = 0;
int[] k = {104, 101, 108, 108, 111, 32};
for (int i = h.length-1; i > -1; i--){
h[i] = (char) k[o++];
System.out.print(h[i]);
}
}
}

class WorldText implements Runnable
{
public void run()
{
int k = 100;
char kkkkkk = (char) 100+10+9;
char kkkkk = (char) 3*((2*15)+7);
char kkkk = (char) Math.sqrt(12996);
char kkk = (char) 0+(-1)+108+(1)*1;
char kk = (char) k;
  
System.out.println(kkkkkk+""+kkkkk+kkkk+kkk+kk);
}
static int excla(){
int i = (int) Math.pow(3,3)+6;
return i;
}
}
public class Main
{
public static void main(String[] args)
{
Thread worldt = new Thread(new HelloText());
Thread hellot = new Thread(new WorldText());
try
{
worldt.start();
worldt.join();
hellot.start();
hellot.join();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Output

---

all the best


Related Solutions

Modify the following source code so that five subsequent threads print the message “Hello World number,”...
Modify the following source code so that five subsequent threads print the message “Hello World number,” where number indicates the unique thread created; e.g. “Hello World 1” // Your_name_goes_here #include <pthread.h> #include <semaphore.h> sem_t semaphore; // also a global variable just like mutexes void *thread_function( void *arg ) { sem_wait( &semaphore ); // perform some task pthread_exit( NULL ); } int main() { int tmp; tmp = sem_init( &semaphore, 0, 0 ); // initialize pthread_create( &thread[i], NULL, thread_function, NULL );...
C++: How are std::cout << “hello world” and std::cout << “hello” << ‘ ‘ << “world”...
C++: How are std::cout << “hello world” and std::cout << “hello” << ‘ ‘ << “world” different?
Psychotic disorders and schizophrenic disorders are some of the most complicated and challenging diagnoses in the...
Psychotic disorders and schizophrenic disorders are some of the most complicated and challenging diagnoses in the DSM. The symptoms of psychotic disorders may appear quite vivid in some clients; whereas, within other clients, symptoms may be barely observable. Additionally, symptoms may overlap among disorders. For example, specific symptoms such as neurocognitive impairments, social problems, and illusions may exist in schizophrenic clients, but are also contributing symptoms for other psychotic disorders. For this Discussion, consider whether experiences of psychosis-related symptoms are...
(Java Zybooks) Print "Censored" if userInput contains the word "darn", else print userInput. End with newline....
(Java Zybooks) Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn cat.", then output is: Censored Ex: If userInput is "Dang, that was scary!", then output is: Dang, that was scary! Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message....
Write a complete Java program to print out the name bob
Write a complete Java program to print out the name bob
Hello, How can I make the program print out "Invalid data!!" if the file has a...
Hello, How can I make the program print out "Invalid data!!" if the file has a grade that is not an A, B, C, D, E, or F or a percentage below zero. The program should sort a file containing data about students like this for five columns: one for last name, one for first name, one for student ID, one for student grade percentage, one for student grade. Smith Kelly 438975 98.6 A Johnson Gus 210498 72.4 C Reges...
in java Print a list of seats in a theater. Rows are numbered, columns lettered, as...
in java Print a list of seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat. Create a nested loop to print the following: 1A 1B 1C 1D 3A 3B 3C 3D 5A 5B 5C 5D
Write a java program that will take a line of input and go through and print...
Write a java program that will take a line of input and go through and print out that line again with all the word numbers swapped with their corresponding numeric representations (only deal with numbers from one to nine). Sample runs might look like this: Please enter a line of input to process: My four Grandparents had five grandchildren My 4 grandparents had 5 grandchildren without array and methods.
Write a program in Java that initializes an array with ten random integers and then print...
Write a program in Java that initializes an array with ten random integers and then print three lines of output, containing: Every element at an odd index Every odd element All elements in reverse order   The program should use three different methods to implement the functionalities above. Call the primary source file ArrayManipulator.java
java. please don't use complicated language I can follow up. Write a for loop that prints...
java. please don't use complicated language I can follow up. Write a for loop that prints the integers from 1 to 100, all on one line, space-separated. However, after printing 3 numbers, you need to skip the next number and print a counter in parenthesis. 1 2 3 (1) 5 6 7 (2) 9 10 11 (3) 13 14 15 (4) 17 18 19 [... and so on ...] Write this code once with for loop, once with while loop,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT