#public static void main string args
Explore tagged Tumblr posts
auroras-void · 2 years ago
Text
Tumblr media
88 notes · View notes
stvr-syntvx-errvr · 2 months ago
Text
𝗋𝖾𝖻𝗈𝗈𝗍𝗂𝗇𝗀… [𝗅𝗈𝖺𝖽𝗂𝗇𝗀 1 / 5]..
//██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// ⚠︎ WARNING: UNAUTHORIZED ACCESS DETECTED ⚠︎
// ⚠︎ This terminal contains:
// - FLASHING TEXT SIMULATION (epilepsy risk)
// - UNSTABLE CODE FRAGMENTS (may crash your IDE)
// - POSSIBLE 18+ CONTENT (lesbian space witches, blasphemous code)
// NOT SUITABLE FOR MOBILE USERS
// ⚠︎ PROCEED? [Y/N] >>> (autoselecting Y...)
// YOU HAVE BEEN WARNED
// ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
Tumblr media Tumblr media Tumblr media
public class PinnedPost {
// [SYNTAX WARNING 555] Class may contain traces of stardust
///// --——— ✦ CORRUPTED MAIN METHOD ✦ ———-- /////
public static void main(String[] args) throws InterruptedException{
System.err.println("\n\u001B[31m ⚠︎INITIATING USER PROFILE... HOLD... ⚠︎\u001B[0m");
Thread.sleep(1000);
System.err.println(WhoAmI.getInfo());
}
}
Tumblr media Tumblr media
Tumblr media
public class WhoAmI {
// ✧・゚: *✧・゚:* FIELDS *:・゚✧*:・゚✧
private static String name = "stvr";
// (pronounced: star)
private static String[] pronouns = {"he", "they", "star"};
private static int age = 20;
private static String identity = "nonbinary lesbian";
//taken by my wifey @bloomdolly
private static String major = "computer science";
private static String religion = "hellenistic revivalist";
private static String[] goddesses = {"aphrodite", "artemis", "athena", "hestia"};
private static String[] roles = {"lover", "gamer", "artist", "programmer", "astrologer"};
Tumblr media Tumblr media Tumblr media
// ✧・゚: *✧・゚:* BROKEN METHOD *:・゚✧*:・゚✧
public static String getInfo() {
String info = "╔════════════════════════════╗\n";
info += "╟┤ USER: " + name.toUpperCase() + " u001B[5m⟢\u001B[0m" + " ║\n";
info += "╟┤ PRONOUNS: " + String.join("/", pronouns) + " ║\n";
info += "╟┤ AGE: " + age + " ║\n";
info += "╟┤ IDENTITY: " + identity + " ║\n";
info += "╟┤ MAJOR: " + major + " ║\n";
info += "╟┤ RELIGION: " + religion + " ║\n";
info += "╟┤ DIVINE PATRONS: " + String.join(" & ", goddesses) + " ║\n";
info += "╟┤ ROLES: " + String.join(" + ", roles) + " ║\n";
info += "╚════════════════════════════╝";
info += "\n\u001B[31m[ERROR] MISSING BRACE? // [DEBUG] TERMINATE PROCESS? (Y/N)\u001B[0m";
return info;
}
// [DEBUG] Uncomment to crash:
// public static void main(String[] args) {System.exit(1); }
}
// ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// ⚠︎ WARNING: TERMINAL CLOSING�� ⚠︎
// ⚠︎ REBOOT REQUIRED TO CLEAR CORRUPTED DATA
// ⚠︎ (come home)
// ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ credit to @animatedglittergraphics-n-more for the graphics I used
// follow file types below for 0th3r aw3s0m3 stuff
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
11 notes · View notes
a-lost-archivist · 4 months ago
Note
import java.util.Scanner;
class Main { public static void main(String[] args) { Scanner iSeeYouMartin = new Scanner(System.in); System.out.println("Enter a name:"); String name = iSeeYouMartin.nextLine(); System.out.println(name + " is being watched.");
}
}
I-
I’m sorry what?
I mean this is uhm.. probably the most creative threat I’ve gotten..? But I- I’m so confused right now what??
7 notes · View notes
redfoxbytes · 5 months ago
Text
Java
Eines meiner ersten Codes die ich in Java geschrieben habe, war das hier:
public class JunusVideo { public static void main(String[] args) {
String name = "Mulder"; String beruf = "Programmierer";
gruss(19);
System.out.println("Ich heiße " + name + " und Arbeite als " + beruf + "."); }
public static void gruss(int hour) {
if (hour < 12) { System.out.println("Guten Morgen!"); } else if (hour < 18) { System.out.println("Guten Tag!"); } else { System.out.println("Guten Abend!"); } } }
Das erste was ich getippt habe und verstanden habe. Ich war sehr stolz darauf. :) Vor allem, weil ich ihn etwas anders gemacht hatte, als im Tutorial und sehr stolz darauf war.
Apropos Tutorial, gelernt habe ich von Junus auf Youtube. Tolle Videos. Sehr einfach erklärt. Kann ich jedem wärmstens ans Herz legen, der erst einsteigt.
youtube
2 notes · View notes
nectoy7 · 9 months ago
Text
My First Java Program: A Journey into Coding
Tumblr media
Starting with Java programming can be an exciting journey, filled with discovery, challenges, and a sense of accomplishment. My experience of writing my first Java program was a significant milestone that opened up a world of possibilities in software development. In this blog, I’ll share my journey through writing my first Java program, along with the concepts I learned and the obstacles I overcame.
The Excitement of Starting
When I first decided to learn Java, I was motivated by its versatility and widespread use in developing applications, from mobile apps to enterprise software. I had heard about the power of Java and how it is a foundational language for many developers. After setting up my Java development environment, which included installing the Java Development Kit (JDK) and choosing an Integrated Development Environment (IDE) like Eclipse, I was ready to dive in.
The anticipation of writing my first program filled me with excitement. I had heard many experienced programmers talk about how exhilarating it felt to see their code come to life, and I was eager to experience that feeling myself.
Setting Up the Development Environment
Before I could write my first program, I needed to ensure my development environment was properly configured. Here’s a brief overview of how I set it up:
1. Installing the JDK: I downloaded the latest version of the Java Development Kit from the Oracle website. This included everything I needed to compile and run Java applications.
2. Choosing an IDE: I chose Eclipse as my IDE because of its robust features and user-friendly interface. After downloading and installing it, I was ready to start coding.
3. Verifying the Installation: I opened the command prompt (or terminal) and typed java -version to confirm that Java was installed correctly. Seeing the version number displayed confirmed that I was on the right track.
Writing My First Java Program
With my development environment set up, I was finally ready to write my first Java program. Following the traditional approach, I decided to create a simple ��Hello, World!” program. This classic exercise is often the first step for beginners learning any programming language.
Step 1: Creating a New Java Project
In Eclipse, I created a new Java project:
1. File > New > Java Project.
2. I named the project “HelloWorld” and clicked Finish.
Step 2: Creating a New Java Class
Next, I created a new Java class within the project:
1. Right-click on the src folder in the HelloWorld project.
2. Selected New > Class.
3. I named the class HelloWorld and checked the box to include the public static void main(String[] args) method. This method is the entry point of any Java application.
Step 3: Writing the Code
With the class created, I wrote the code that would print “Hello, World!” to the console:
public class HelloWorld {     public static void main(String[] args) {         System.out.println(“Hello, World!”);     } }
Code Explanation
public class HelloWorld: This line defines a public class named HelloWorld. In Java, every application must have at least one class.
public static void main(String[] args): This line declares the main method, which is the starting point of any Java program. The JVM (Java Virtual Machine) looks for this method when executing the program.
System.out.println(“Hello, World!”);: This line prints the string “Hello, World!” to the console. The System.out object is used to output data to the console, and println is a method that prints the text followed by a newline.
Step 4: Running the Program
After writing the code, it was time to run my program and see the result:
1. I right-clicked on the HelloWorld.java file in the Project Explorer.
2. Selected Run As > Java Application.
To my delight, the console displayed the message “Hello, World!” It was a simple program, but seeing the output felt like a monumental achievement. I had successfully written and executed my first Java program!
Learning from the Experience
The process of writing my first Java program taught me several important lessons:
Understanding Java Syntax
Java has a specific syntax that must be followed. This includes rules about naming conventions, the use of semicolons to end statements, and the structure of classes and methods. Understanding these rules is essential for writing valid Java code.
The Importance of the Main Method
The main method is crucial in Java applications. It serves as the entry point, and every program must have it to be executed. Learning this concept helped me appreciate how Java applications are structured.
The Power of Output Statements
Using System.out.println() was my first experience with output statements. It highlighted the importance of feedback in programming. Being able to print messages to the console is invaluable for debugging and understanding program flow.
Overcoming Challenges
While writing my first Java program was largely straightforward, I faced some challenges along the way:
Syntax Errors
Initially, I encountered syntax errors due to missing semicolons or misnamed classes. Each error message provided insight into what I needed to correct. This experience emphasized the importance of careful coding and attention to detail.
Understanding the IDE
Familiarizing myself with Eclipse took some time. I had to learn how to navigate the interface, manage projects, and use features like code suggestions and debugging tools. As I continued coding, I became more comfortable with the IDE.
Next Steps in My Java Journey
Completing my first Java program was just the beginning. With a foundational understanding of Java syntax and structure, I was excited to explore more advanced concepts. Here are the next steps I took in my learning journey:
Exploring Java Basics
I delved deeper into Java basics, including:
Data Types: Understanding primitive and reference data types.
Variables: Learning how to declare and use variables effectively.
Operators: Exploring arithmetic, relational, and logical operators.
Control Flow Statements: Mastering if-else, switch, and loop constructs.
Learning Object-Oriented Programming (OOP)
Java is an object-oriented programming language, and I knew I had to understand OOP principles. I focused on concepts such as:
Classes and Objects: Learning how to create and manipulate objects.
Inheritance: Understanding how classes can inherit properties from other classes.
Encapsulation: Learning how to hide data within classes.
Polymorphism: Exploring method overloading and overriding.
Building Projects
I started working on small projects to apply my knowledge. Simple applications, like a calculator or a text-based game, helped solidify my understanding of Java concepts.
Conclusion
Writing my first Java program was a thrilling experience that marked the beginning of my journey as a programmer. The excitement of seeing my code come to life, coupled with the knowledge I gained, fueled my desire to continue learning and growing in the field of software development.
Java has proven to be a powerful language with endless possibilities, and I am eager to explore its depths further. With each program I write, I feel more confident in my coding abilities and more inspired to tackle new challenges.
If you’re starting your Java journey, embrace the process, celebrate your successes, and don’t shy away from challenges. Each step you take brings you closer to becoming a proficient Java developer.
Happy coding!
2 notes · View notes
yourlocalnerd07 · 1 year ago
Text
public static void main(String[] args) { System.out.println(":333"); }
7 notes · View notes
yuriinullification · 10 months ago
Text
i've been like tangentially aware of that public static void main(string[] args) code that always sits at the top of c# and java projects for years from memes about how unnecessarily long it is, and how it really doesn't do that much, but slowly learning what it actually is and being able to break it down on my own hand into its separate components is genuinely somewhat fun
2 notes · View notes
mumblingstudent · 1 year ago
Text
Написать программу на Java без текстовых редакторов?
Программу на java можно создать, используя одну командн��ю строку. (по крайней мере на windows, хз что там у других систем)
Познакомимся с некоторыми командами:
echo - команда для вывода текста. Она будет записывать код в файл;
javac - компилятор. Переведёт код в байт-код;
java - загрузчик приложений. Запускает код.
Открываем cmd. Пишем:
echo class CmdHi { public static void main(String[] args) { System.out.println("I am a good programmer!"); } } > CmdHi.java
Создастся файл CmdHi.java, внутрь запишется код, который при выполнении выведет строчку "I am a good programmer!".
Чтобы посмотреть содержимое файла, можно использовать команду more:
more CmdHi.java Вывод: class CmdHi { public static void main(String[] args) { System.out.println("I am a good programmer!"); } }
Далее программу надо скомпилировать:
javac CmdHi.java
После чего можем запустить код, указав скомпилированный класс:
java CmdHi
Результат:
I am a good programmer!
Скрин для наглядности
Tumblr media
Кстати, с 11 версии джавы простейшие программы не требуют компиляции, поэтому сразу после echo можно сделать так
java Hi.java
Н��блюдение: русские символы при выводе в командной строке могут не читаться
Tumblr media
4 notes · View notes
voidsentprinces · 2 years ago
Text
Youtube: We are banning adblockers
Coders:
import java.util.Date;
public class TheFuckYouAre {    public static void main(String[] args) {        int x, y;        x = 0;        y = 1;        for(int i =0; i < 20; i++) {          System.out.print(x + "\t");          int t = y;          y = x +y;          x = t;        }    } }
17 notes · View notes
Text
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import java.util.Random;
public class MoonShapes extends Application {
private final Random random = new Random();
@Override
public void start(Stage primaryStage) {
Group root = new Group();
Scene scene = new Scene(root, 800, 600, Color.BLACK);
int numMoonShapes = 10;
for (int i = 0; i < numMoonShapes; i++) {
double centerX = random.nextDouble() * scene.getWidth();
double centerY = random.nextDouble() * scene.getHeight();
double radius = 20 + random.nextDouble() * 50; // Tamaño aleatorio
Color moonColor = generateWarmColor();
Circle outerCircle = new Circle(centerX, centerY, radius, Color.WHITE);
Circle innerCircle = new Circle(centerX - radius / 2, centerY, radius, moonColor);
Rectangle rectangle = new Rectangle(centerX - radius, centerY - radius / 2, radius * 2, radius);
root.getChildren().addAll(outerCircle, innerCircle, rectangle);
}
primaryStage.setScene(scene);
primaryStage.show();
}
private Color generateWarmColor() {
double hue = random.nextDouble() * 60; // Tonos cálidos en el rango de amarillo a rojo
double saturation = random.nextDouble() * 0.5 + 0.5; // Saturación entre 0.5 y 1.0
double brightness = random.nextDouble() * 0.5 + 0.5; // Brillo entre 0.5 y 1.0
return Color.hsb(hue, saturation, brightness);
}
public static void main(String[] args) {
launch(args);
}
}
(Código generado por una inteligencia artificial para crear una obra de arte)
2 notes · View notes
qutopyo · 1 year ago
Text
she public on my static void till i main(String[] args)
2 notes · View notes
marshmallowsamwitch · 1 year ago
Text
"Noooo, programming isn't magic. It doesn't even have nonsensical incantations that feel completely meaningless but actually do something if you manage to get it exactly riiiight!"
public static void main(String[] args){}
3 notes · View notes
king-fae · 1 year ago
Text
11/100 days of code.
1.19.24
today im starting on my java learning journey, with the book Introduction to Java: Programming and Data Structures 12th Edition by Y. Daniel Liang. before jumping in, i cant help but be very excited to learn java for the explicit purpose of coding minecraft mods, as that sounds like a super fun project and usage of this language for me :P ultimately game dev is why im learning c++, so having a game dev equivalent usage for java will help me retain it in the long term, as i already have interest in that application. i intend on eventually learning pygame to retain and stretch my python knowledge for the same purpose, though i dont have something specific like minecraft modding to work towards, so we'll see.
in the introductory section, im also learning that android phones are developed in Java, making it promising to be able to make android compatible (which is the phone i use) mobile software without much hassle, which is super cool. i also learned that java, like c++, is a compiled language, uses classes (namespaces in c++), has the same commenting system, same use of ; to end statements, and more. while there are a vast amount of differences, finding these similarities is both cool and helpful for retention!
public class Welcome {
......public static void main(String[] args) {
..........System.out.println("Welcome to Java!");
.....}
}
4 notes · View notes
infinitethree · 2 years ago
Text
OOC::
Hey remember this ask? It becomes Relevant! :D
Cat ask is the gift that keeps on giving.
2 notes · View notes
the-post-programmer · 1 year ago
Text
public class PrintLetters { public static void main(String[] args) { String phrase = "in the club, straight up thinking it. and by it, lets just say, my thoughts"; printLettersByWord(phrase); }public static void printLettersByWord(String phrase) { String[] words = phrase.split("\\s+"); for (String word : words) { for (int i = 0; i < word.length(); i++) { System.out.print(word.charAt(i) + " "); } System.out.print("| "); // Separate words by '|' } }
} Your post has been programmed! this is the first time ive done something like this, so I hope your ok with that!
in the club, straight up "thinkang it". and by "it", lets just say. my thouts
28K notes · View notes
vatt-world · 9 days ago
Text
hi
import java.util.HashMap; import java.util.Map;
public class FrequencyCounter { public static void main(String[] args) { int[] nums = {2, 3, 2, 5, 3, 2}; Map<Integer, Integer> frequencyMap = new HashMap<>(); for (int num : nums) { frequencyMap.put(num, frequencyMap.getOrDefault(num, 0) + 1); } // Print the result for (Map.Entry<Integer, Integer> entry : frequencyMap.entrySet()) { System.out.println("Number " + entry.getKey() + " appears " + entry.getValue() + " times."); } }
} ////////////////////
rray = [2, 1, 5, 1, 3, 2] target = 8 We’ll find the longest subarray where the sum is ≤ 8.
We use left, right, and sum to control and track the window .int left = 0, sum = 0, max = 0;
left: starting point of our sliding window
sum: running total of the current window
count: total number of valid subarrays we find
for (int right = 0; right < array.length; right++) { Expands the window by moving the right pointer forward. sum += array[right]; while (sum > target) { sum -= array[left]; left++; } max = Math.max(max, right - left + 1); }
/// Inheritance Inheritance allows a class to inherit fields and methods from another class. It supports code reuse and method overriding.
🔹 10. Polymorphism Polymorphism lets you perform the same action in different ways. It includes compile-time (overloading) and runtime (overriding) polymorphism.
🔹 11. Encapsulation Encapsulation binds data and methods together, hiding internal details. It’s achieved using private fields and public getters/setters.
🔹 12. Abstraction Abstraction hides complex implementation details and shows only the essentials. It’s achieved using abstract classes or interfaces.
List allows duplicates, Set allows only unique elements, Map stores key-value pairs. They are part of the Java Collections Framework f
Lambdas enable functional-style code using concise syntax. They simplify the implementation of functional interfaces.
🔹 19. Functional Interfaces A functional interface has exactly one abstract method. Examples include Runnable, Callable, and Comparator.
Stream API processes collections in a functional and pipeline-based way. It supports operations like filter(), map(), and collect()
Heap stores objects and is shared, while Stack stores method calls and local variables. Stack is thread-safe; Heap is managed by the garbage collector.
Immutable objects, like String, cannot be changed once created. They are thread-safe and useful in concurrent applications.
int left = 0, right = array.length - 1; while (left < right) { if (array[left] + array[right] == target) { // Found pair } else if (array[left] + array[right] < target) { left++; } else { right--; } } //////////////////
kafka partitions
List inputList = // input data Map uniqueMap = new HashMap<>();
for (Person person : inputList) { String key = person.name + "_" + person.age;if (!uniqueMap.containsKey(key)) { uniqueMap.put(key, person); // first time seeing this name+age } else {
///
List people = Arrays.asList( new Person("Alice", 30), new Person("Bob", 25), new Person("Charlie", 35) ); // Sort by age using lambda people.sort((p1, p2) -> Integer.compare(p1.getAge(), p2.getAge()));
////////////////
public Person(String name, int age) { this.name = name; this.age = age; }@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Person)) return false; Person person = (Person) o; return age == person.age && Objects.equals(name, person.name); } @Override public int hashCode() { return Objects.hash(name, age); }
}
/////////// hashCode() is used by hash-based collections like HashMap, HashSet, and Hashtable to find the bucket where the object should be placed.
bject.equals() method compares memory addresses
///
List people = Arrays.asList( new Person("Alice", 30), new Person("Bob", 25), new Person("Charlie", 35) ); // Sort by age using lambda people.sort((p1, p2) -> Integer.compare(p1.getAge(), p2.getAge())); // Print sorted list people.forEach(System.out::println); }
///
0 notes