├── Day_1 └── src │ ├── com │ └── masai │ │ ├── DiffPrintStatement.java │ │ └── Main.java │ └── module-info.java ├── Day_2 └── src │ └── Main.java ├── Day_3 └── src │ ├── SimpleInterest.java │ └── SimpleInterestTester.java └── README.md /Day_1/src/com/masai/DiffPrintStatement.java: -------------------------------------------------------------------------------- 1 | package com.masai; 2 | 3 | public class DiffPrintStatement { 4 | 5 | public static void main(String[] masai) { 6 | 7 | 8 | System.out.print("Twinkle Twinkle"); 9 | System.out.println("Little Star"); 10 | System.out.print("How I wonder what you are\n"); 11 | System.out.println("Up above the world so high"); 12 | System.out.println("Like a diamond in the sky"); 13 | // 14 | // 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Day_1/src/com/masai/Main.java: -------------------------------------------------------------------------------- 1 | package com.masai; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello World"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Day_1/src/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | /** 5 | * @author shubh 6 | * 7 | */ 8 | module Day_1 { 9 | } -------------------------------------------------------------------------------- /Day_2/src/Main.java: -------------------------------------------------------------------------------- 1 | 2 | public class Main { 3 | 4 | public static void main(String[] args) { 5 | 6 | System.out.println("DAY-2 JA111"); 7 | 8 | } 9 | 10 | 11 | /* Q.1 Match the following 12 | (a) static (i) Character Literal 13 | (b) costPrice (ii) Keyword 14 | (c) sell-price (iii) Invalid Variable Name 15 | (d) '\u8762' (iv) Valid Variable Name 16 | 17 | answer:- 18 | (a) => (ii); 19 | (b) => (iv)Valid Variable Name; 20 | (c) => (iii)Invalid Variable Name; 21 | (d) => (i)Character Literal 22 | */ 23 | 24 | 25 | /* Q.2 What is output of following code? 26 | 27 | int a = 10; 28 | boolean b = !false && (++a == 11 && a++ == 11); 29 | System.out.println(a + “ ” + b); 30 | 31 | (a) 11 true 32 | (b) 12 false 33 | (c) 12 true 34 | (d) None of these 35 | 36 | 37 | answer : (c) true 38 | 39 | */ 40 | 41 | 42 | /* Q.3 Say a person want to vote in india such that two conditions are required to met 43 | (i) age of person must be more than or equal to 18 44 | (ii) person must be indian 45 | Select the appropriate operators for the condition of if statement 46 | 47 | int age = some-value; 48 | String nationality = some-value; 49 | if(age _ 18 _ nationality __ "indian") 50 | System.out.println(“Can Vote”); 51 | else 52 | System.out.println(“Can’t Vote”); 53 | (a) >, &&, = 54 | (b) >, ||, == 55 | (c) >=, ||, = 56 | (d) >=, &&, == 57 | 58 | answer : (d)>=, &&, == 59 | 60 | */ 61 | 62 | /* Q.4 What is output of following code? 63 | 64 | int a = 5; 65 | while(a--){ 66 | System.out.print(“* ”); 67 | } 68 | 69 | (a) * * * * * 70 | (b) * * * * 71 | (c) This loop will run for infinite time 72 | (d) Compile Time Error 73 | 74 | 75 | answer : (c)This loop will run for infinite time 76 | */ 77 | 78 | 79 | 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /Day_3/src/SimpleInterest.java: -------------------------------------------------------------------------------- 1 | 2 | public class SimpleInterest { 3 | 4 | 5 | double principleAmount; 6 | double timePeriod; 7 | double interestRate; 8 | 9 | 10 | void setValues(double pa, double tp, double ir) { 11 | this.principleAmount=pa; 12 | this.timePeriod=tp; 13 | this.interestRate=ir; 14 | } 15 | 16 | 17 | double getInterestAmount() { 18 | 19 | double ans = (principleAmount*timePeriod*interestRate)/100; 20 | ans =Math.round(ans*100.0)/100.0; 21 | return ans; 22 | 23 | } 24 | 25 | } 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Day_3/src/SimpleInterestTester.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | public class SimpleInterestTester{ 5 | 6 | public static void main(String[] args) { 7 | 8 | SimpleInterest s1 = new SimpleInterest(); 9 | SimpleInterest s2 = new SimpleInterest(); 10 | 11 | 12 | 13 | 14 | s1.setValues(1005, 2, 7.5); 15 | s2.setValues(1235.50, 2.5, 8.25); 16 | 17 | double spFors1 = s1.getInterestAmount(); 18 | double spFors2 = s2.getInterestAmount(); 19 | 20 | 21 | System.out.println("Simple Interest for s1 is "+ spFors1); 22 | System.out.println("Simple Interest for s2 is "+ spFors2); 23 | 24 | 25 | 26 | 27 | 28 | } 29 | 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Core-JAVA Projects 🚀✨ 2 | 3 | This repository contains three projects developed in Core Java to solve basic problem statements. The projects focus on different aspects of Core Java, including console printing, multiple-choice questions, and simple interactive problems. 4 | 5 | ## Project 1: Console Printing 6 | 7 | 🖨️💬 This project demonstrates the basic functionality of console printing in Core Java. It provides examples and explanations of various methods and techniques for printing output to the console. You can explore the project to understand different ways of printing messages and formatting the output in the console. 8 | 9 | ## Project 2: Multiple Choice Questions 10 | 11 | ❓📝 The second project in this repository is a collection of multiple-choice questions related to Core Java. These questions cover various topics such as data types, control statements, object-oriented programming, exception handling, and more. Each question is accompanied by multiple options, and you can test your knowledge by selecting the correct answer. 12 | 13 | ## Project 3: Simple Interactive Problems 14 | 15 | 🔨🎮 In this project, you will find a set of basic interactive problems that can be solved using Core Java concepts. These problems are designed to help you practice your programming skills and reinforce your understanding of fundamental concepts such as loops, conditionals, and data structures. You can run the code provided in each problem and interact with it to see the expected output. 16 | 17 | ## Getting Started 18 | 19 | 📋 To get started with these projects, follow the steps below: 20 | 21 | 1. Clone this repository to your local machine using the following command: 22 | ``` 23 | git clone https://github.com/Shubh2-0/Core-JAVA.git 24 | ``` 25 | 26 | 2. Explore each project's directory to understand its purpose and contents. 27 | 28 | 3. Compile and run the Java code in your preferred development environment. 29 | 30 | 4. Follow the instructions and comments within each project to interact with the programs and solve the problem statements. 31 | 32 | ## Contributions 33 | 34 | 🤝🌟 Contributions to this repository are welcome! If you have any improvements, bug fixes, or new projects related to Core Java, feel free to open a pull request. Make sure to follow the existing coding style and provide appropriate documentation for your changes. 35 | 36 | ✨🔧 Have fun coding and exploring Core Java! 37 | 38 | 🔗 Repository Link: [https://github.com/Shubh2-0/Core-JAVA.git](https://github.com/Shubh2-0/Core-JAVA.git) 39 | 40 | ## 📬 Contact 41 | 42 | If you want to contact me, you can reach me through below handles. 43 | 44 |

45 | linkedin  46 | mail-me  47 | whatsapp-me  48 |

49 | 50 |
51 | 52 | 53 | 54 | --------------------------------------------------------------------------------